Memory Management: Memory Deallocation
In this lesson, we will learn about the second subsection of memory management - memory deallocation.
We'll cover the following...
Memory Deallocation
delete
A new
with previously allocated memory will be deallocated with delete
.
Circle* c= new Circle;
...
delete c;
The destructors of the object and the destructors of all base classes will be automatically called. If the destructor of the base class is virtual, we can destroy the object with a ...