1.

Where are the automatic variables stored if another function is called in between the execution of the program?(a) Heap(b) Queue(c) Stack(d) Temp variableI had been asked this question at a job interview.I need to ask this question from Automatic Variable in portion Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

The correct answer is (c) STACK

The best EXPLANATION: All the automatic variables are stored in a new stack entry as soon as their scope is created. If another function is called, the PRESENT data is saved in stack and new entry in stack is MADE for the called function. When the function returns, the automatic variables are used again from where those were left.



Discussion

No Comment Found

Related InterviewSolutions