1.

The memory allocated for an object ____________________(a) Can be only dynamic(b) Can be only static(c) Can be static or dynamic(d) Can’t be done using dynamic functionsThe question was posed to me in an internship interview.The query is from Overloading Member Functions topic in section Member Functions & its Types of Object Oriented Programming

Answer»

The CORRECT choice is (c) Can be static or dynamic

The explanation is: The memory allocation for an OBJECT can be static or dynamic. The static memory allocation is when an object is declared DIRECTLY without USING any function usually. And dynamic allocation is when we use some dynamic allocation function to ALLOCATE memory for data member of an object.



Discussion

No Comment Found

Related InterviewSolutions