Release of Memory

In this lesson, we will learn about the second component of memory management, i.e., memory deallocation.

We'll cover the following...

delete #

The delete operator deallocates the memory allocated by the new operator.

Point* p = new Point(1.0, 2.0);
delete p;

If the deleted object belongs to a type hierarchy, the ...