1.

When we are using heap operations what do we need to do to save the memory?(a) rename the objects(b) delete the objects after processing(c) both rename & delete the objects(d) add the objectsThis question was posed to me in exam.This intriguing question originated from Large Objects in portion Source Files, Classes and Operator Overloading in C++ of C++

Answer»

Correct OPTION is (b) delete the OBJECTS after processing

Easy explanation - When you allocate memory from the HEAP, you must remember to CLEAN up objects when you’re done! Failure to do so is called a memory LEAK.



Discussion

No Comment Found

Related InterviewSolutions