Destructor :-
it is also special member of class having same name but is defined with (tilde) ~ sign.
- It can be parameterised.
- It can’t be overloaded.
- It does not return a value even void.
- It is called automatically when delete an object.
Example:-
#include<iostream.h>#include<conio.h>classpix{public:pix(){cout<<“\n This is constructor”;}
~pix(){cout<<“\n This is destructor”;}};void main(){clrscr();pix *op=new pix();delete op;getch();}