What is the purpose of a destructor?
It allows the programmer to write the necessary code to free the resources acquired by the object prior to deleting the object itself.
There are no destructors in C++.
It deletes an object. One example of a destructor is the delete() function.
delete()
It terminates a program. This may be achieved as a regular function call or as an exception.