previous | start | next

Automatic Memory Management (Syntax 17.2 : Destructor Definition)

Syntax 17.2 : Destructor Definition

Class_name::~Class_name()
{   statements
}
Example:
Department::~Department()
{
   delete receptionist;
}
Purpose: Supply the implementation of a destructor that is invoked whenever and object goes out of scope.


previous | start | next