1.

Which of the following results in the allocation of memory for the extern variables?(a) Declaration(b) Definition(c) Including file(d) Memory is not allocated for extern variablesI have been asked this question in my homework.Asked question is from Extern Variable in chapter Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

Correct ANSWER is (b) Definition

For EXPLANATION: The memory for the extern VARIABLES are allocated DUE to their definition. When the variables are declared, it only indicates the compiler that the variable is going to be used somewhere. But definition makes the compiler to ALLOCATE the memory for the variables.



Discussion

No Comment Found

Related InterviewSolutions