1.

What does a header file contain for an extern variable?(a) Only declaration of variables(b) Only definition of variables(c) Both declaration and definition of variables(d) Neither declaration nor definitionThis question was posed to me in examination.Enquiry is from Extern Variable in division Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

Right option is (a) Only declaration of variables

The best explanation: The HEADER file only CONTAINS the declaration of variables that are extern. It doesn’t contain any static VARIABLE definitions.



Discussion

No Comment Found

Related InterviewSolutions