Destructor : Desructor is member function which is destroy automatically when object is created.
Destructor always must start with ~ Key Sign.
Syntax:
class class_ Name
{
~ constructor Name ( ) // Destructor
};
Example:
class A
{
int i;
public();
~ A();
}
A : A();
{
i=1;
}
0 comments:
Post a Comment