Storage Class Questions and Answers

Practice Mode
Showing 10 of 97 questions
Q81
Which of the following statement is incorrect.
  • A idenfitiers with external linkage can be seen (and refered to) in other translation units.
  • B Identifiers with internal linkage can only be seen within the translation unit
  • C Identifiers with no linkage can only be seen in the scope in which they are defined.
  • D None of these
Answer: Option D
Q82
A function declared inside a block will usually have
  • A external linkage
  • B Internal linkage
  • C No linkage
  • D Function linkage
Answer: Option B
Q83
Which storage class is used to give a reference of global variable that is visible to all program files ?
  • A static
  • B auto
  • C register
  • D extern
Answer: Option D
Q84
Which of these is/are true about local variables
  • A Local variables only exist inside the specific function that creates them.
  • B Local variables are allocated memory on the stack.
  • C Local variables are not initialized automatically.
  • D All of these
Answer: Option D
Q85
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];
  • A 100 20
  • B 100 2
  • C Compilation error
  • D None of these
Answer: Option C
Q86
Which of the following is true about stack variables ?
  • A These are non-static
  • B these are local variables in a function or inside a compound statement.
  • C Outside a function or compound statement, it's value will be lost.
  • D All of these
Answer: Option D
Q87
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; }
  • A 5
  • B 7
  • C 0
  • D Compilation error
Answer: Option B
Q88
Global variables has
  • A Internal linkage
  • B External linkage
  • C No linkage
  • D Allocation linkage
Answer: Option B
Q89
Data members of an anonymous union is
  • A External linkage
  • B Internal linkage
  • C No linkage
  • D Anonymous linkage
Answer: Option B
Q90
Variables which are used repeated repeatedly or whose access times are critical, declared as
  • A auto
  • B static
  • C register
  • D extern
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test