Table of Contents
Previous Section Next Section

delete

The delete operator frees the memory pointed to by its argument. This memory must have previously been allocated using new. The general form of delete is

delete p_var;

where p_var is a pointer to previously allocated memory.

To free an array that has been allocated using new, use this general form of delete:

delete [ ] p_var;


Table of Contents
Previous Section Next Section