Which condition is true if the extern variable is used in a file?

Which condition is true if the extern variable is used in a file?
A. All the header files declare it
B. Only few required files declare it
C. All header files declared it if required
D. Only one header file should declare it
 
Answer: d
Explanation: Only one header file should declare the extern variable to be used. There must not be more than one file declaring the same extern variable. This is to ensure that there is no ambiguity in using the extern variable.
 

Tìm kiếm

Back
Top