Delete

The 'delete' Operator

The delete operator does the opposite of the new operator. The statement delete pointerVariable; deallocates a memory block pointed to by pointerVariable, which must have been previously allocated by new. If pointerVariable is null, delete has no effect.

new pointerVariable;
delete pointerVariable;