Storage Class Questions and Answers
Storage Class Questions with Answers are a core part of C programming aptitude and interview tests. These programming questions and answers cover storage types like auto, static, register, and extern, which define variable scope and lifetime. Frequently asked in Wipro, Tech Mahindra, and TCS exams, storage class MCQs evaluate your understanding of memory management and code optimization. Solving these C programming MCQs with detailed explanations will enhance your technical readiness. You can practice online or download free PDFs of storage class questions for quick revision.
Storage Class
Showing 10 of
97 questions
81. Which of the following statement is incorrect.
- idenfitiers with external linkage can be seen (and refered to) in other translation units.
- Identifiers with internal linkage can only be seen within the translation unit
- Identifiers with no linkage can only be seen in the scope in which they are defined.
- None of these
82. A function declared inside a block will usually have
- external linkage
- Internal linkage
- No linkage
- Function linkage
83. Which storage class is used to give a reference of global variable that is visible to all program files ?
- static
- auto
- register
- extern
84. Which of these is/are true about local variables
- Local variables only exist inside the specific function that creates them.
- Local variables are allocated memory on the stack.
- Local variables are not initialized automatically.
- All of these
85. Find the output. #define char stu typedef struct (int x;) char; void main ( ) { extern employee [100]; int ano; extern a; char behaviour; printf('%d", sizeof (employee)); printf('%d", sizeof (a)); } employee [100]; int a[10];
- 100 20
- 100 2
- Compilation error
- None of these
86. Which of the following is true about stack variables ?
- These are non-static
- these are local variables in a function or inside a compound statement.
- Outside a function or compound statement, it's value will be lost.
- All of these
87. Find the output. extern int *show( ); void main ( ) { int *p, x=7; p=show ( ); p=&x; printf("%d", *p); } static int *show ( ) { static int k=5; return &k; }
- 5
- 7
- 0
- Compilation error
88. Global variables has
- Internal linkage
- External linkage
- No linkage
- Allocation linkage
89. Data members of an anonymous union is
- External linkage
- Internal linkage
- No linkage
- Anonymous linkage
90. Variables which are used repeated repeatedly or whose access times are critical, declared as
- auto
- static
- register
- extern