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
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;