It is happening. Note, you can't delete 'p', because you didn't allocate it with 'new' - you are trying to delete something on the stack (a[], in this case), which is a no-no. Also, I would recommend setting points to 0 (NULL, nullptr, whatever) after you delete them, and then any future use of the pointer where you aren't sure if it is valid or not should be something like