1.

Scope of an automatic variable _______________(a) Is actually the whole program(b) Is actually never fixed(c) Is always equal to the whole program execution(d) Is actually function or block in which it is definedThe question was posed to me during an interview.Question is from Automatic Variable topic in chapter Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

Correct answer is (d) Is actually function or BLOCK in which it is defined

The best I can EXPLAIN: The automatic variables scope is LIMITED only WITHIN the block or the function where those are defined. This is the property of all the automatic variables.



Discussion

No Comment Found

Related InterviewSolutions