1.

The static variables of a function ________________(a) Are also automatic variables(b) Are not automatic variables(c) Are made automatic by default(d) Can be made automatic explicitlyThis question was posed to me in final exam.My doubt stems from Automatic Variable topic in division Memory Allocation & Scope of Variable of Object Oriented Programming

Answer» CORRECT answer is (b) Are not automatic variables

Easiest explanation - The STATIC members can’t be automatic. This is because the automatic variables are created and destroyed with each CALL to a specific function. But the static members REMAIN THROUGHOUT the execution of program once created.


Discussion

No Comment Found

Related InterviewSolutions