Is delete dangerous, when delete[] is appropriate?
  Home FAQ Contact Sign in
comp.lang.c++.moderated only
 
Advanced search
POPULAR GROUPS

more...

 Up
Is delete dangerous, when delete[] is appropriate?         

Group: comp.lang.c++.moderated · Group Profile
Author: ted
Date: Jul 10, 2007 04:36

If I use delete, when delete[] is correct, can the consequence be
anything
worse than a memory leak?

E.g.
int* pi = new int[2];
delete pi; // delete[] is correct

(Obviously, let's assume the rest of the program doesn't contain any
errors.)

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
27 Comments
diggit! del.icio.us! reddit!