What is memory leak-00537

Online Quiz This subjective question is related to the book/course vu cs401 Computer Architecture and Assembly Language Programming. It can also be found in vu cs401 Mid Term Solved Past Paper No. 1.

Question 1: What is memory leak?
Answer:
There is a requirement that if the constructor of a class allocates the memory, it is necessary to write a destructor of that class. We have to provide a destructor for that class, so that when that object ceases to exist, the memory allocated by the constructor, is returned to the free store. It is critically important. Otherwise, when the object is destroyed, there will be an unreferenced block of memory. It cannot be used by our program or by any other program. It?s a memory leak that should be avoided.

Choose an organization

Theme Customizer

Gaussian Texture



Gradient Background