Subj : Re: New and Delete memory operators To : comp.programming From : Rob Thorpe Date : Thu Jul 07 2005 02:23 am scoi wrote: > Why , sometime, when I free memory with "delete [] .." I receive an > error message? > > example: > I need an amount of memory and I do it with "new".The function is > finished and I have to free that memory. In this case I do it with > "delete". > > Sometime is ok and another time I see an error. Why? In addition to the possibilities Alan mentioned it could be because you have a bug elsewhere. If you have a bug that writes data incorrectly into the heap it can corrupt the internal data-structures of malloc (or new), causing it to fail at random. This is quite a common bug. As Philips said, post the code to comp.lang.c++ .