1.

Which among the following is true for automatic variables in general?(a) Automatic variables are invisible to called function(b) Automatic variables are always visible to the called function(c) Automatic variables can’t interact with the called function(d) Automatic variables can’t be variableI got this question during an interview.Enquiry is from Automatic Variable topic in section Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

The CORRECT answer is (a) Automatic variables are invisible to called FUNCTION

The best explanation: The automatic variables are hidden from the called function. EVEN if PASSED by reference or address, the address of the variable is used and not the actual variable of calling function. Automatic variables can be const or variable.



Discussion

No Comment Found

Related InterviewSolutions