1.

What is a destructor? Write its syntax.

Answer»

It is a special function used to release the memory space allocated by the object.

General Syntax of Destructors

~ classname();

The above is the general syntax of a destructor. In the above, the symbol tilde ~ represents a destructor which precedes the name of the class.



Discussion

No Comment Found

Related InterviewSolutions