Which of the following results in the allocation of memory for the extern variables?

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 variables
 
Answer: b
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.
 

Tìm kiếm

Back
Top