0
Define Destructors
Define Destructors
Destructor is the antonym to Constructor both in name ans meaning.
Constructor is a special method that initializes the data members of the class and thus allocates the memory space to them.
On the other hand, destructor is a member function which destructs or deletes an object.
A destructor is automatically called when:
They are usually named with the same name as the class name preceded by a tilde (~).