1.

The memory for automatic variables ___________________(a) Have to be allocated and deallocated explicitly(b) Are allocated and deallocated automatically(c) Is never actually allocated(d) Are never safeThe question was asked by my college professor while I was bunking the class.This interesting question is from Automatic Variable in portion Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

The correct choice is (B) Are allocated and DEALLOCATED automatically

To explain I would say: The memory is allocated and deallocated automatically for the automatic variables. As SOON as the variable comes in SCOPE, the memory is allocated. The variables are destroyed as soon as those go out of scope.



Discussion

No Comment Found

Related InterviewSolutions