well one good practice to get into is to set your pointer to null after you delete it
int * a = new int[30];
delete [] a;
a = NULL;
//or
a = 0;
this will make sure the the pointer no longer points to where it used to and will also make it safe to delete again. with the delete function if you call it on a pointer you have already deleted than it will cause an error but calling delete is guaranteed to be safe. the delete function just frees the memory back up to the system. it doesn't actually delete the information in the memory.
NathanOliver
Veteran Poster
1,084 posts since Apr 2009
Reputation Points: 215
Solved Threads: 189
wrong but I thought that may be Delete doesn't delete the data in terms of zeroing it. Instead, it flags the memory as deleted. The actual memory still holds data, the memory manager just knows now that it can overwrite it with new stuff.
jbennet
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,820
Solved Threads: 600