1.

What is delete operator in C++? Give an example.

Answer»

The delete operator in C++ is used for releasing memory space when the object is no longer needed.

General syntax of delete operator in C++:

delete pointer_variable;
For example, delete cptr;
In the above example, delete is a keyword and the pointer variable cptr is the pointer that points to the objects already created in the new operator.



Discussion

No Comment Found