TOPIC 13.4.1
Destructors


The destructor uses the same name as the class except it is preceded with the ~ character. The destructor can not receive arguments, be overloaded, or return values. The class's destructor is called when the program leaves the scope in which the object was declared. The destructor frees memory so that the operating system will be able to reallocate the memory. Destructors are normally used to free memory that was dynamically allocated, so they do not have to be used with simply data types.