1.

Which operator can be used to free the memory allocated for an object in C++?(a) Free()(b) delete(c) Unallocate(d) CollectThe question was asked by my college director while I was bunking the class.My question is taken from Overloading Member Functions topic in section Member Functions & its Types of Object Oriented Programming

Answer»

The correct choice is (b) delete

Easy EXPLANATION - The delete operator in C++ can be used to FREE the memory and resources held by an object. The function can be called explicitly WHENEVER required. In C++ memory management must be DONE by the programmer. There is no AUTOMATIC memory management in C++.



Discussion

No Comment Found

Related InterviewSolutions