Destructors

Destructors

A destructor is a special member function that is called when the lifetime of an object ends. The purpose of the destructor is to free the resources that the object may have acquired during its lifetime.

Syntax

~ class_name (); (1)
virtual ~ class_name (); (2)
decl-specifier-seq(optional) ~ clas