In article <>,
Peter Schuller  <[EMAIL PROTECTED]> wrote:
>> Anything that is allocated with a 
>>          new classtype[] should be deleted with a delete[].
>
>Does anyone know if the C++ language specification actually states that that is
>true?
>
>I've read in books etc that delete[] is supposed to be used, but I don't
>think I've EVER seen it used in the real world. I never use delete[] myself, and
>I have no problems with memory leaks.r

That's because you've never used delete to delete a new[]ed array of objects
which deallocate memory in their destructor.

delete[] calls the destructor for each element of an array of objects.
delete calls the destructor only once for the object pointed to.

-- 
Zygo Blaxell, Linux Engineer, Corel Corporation, [EMAIL PROTECTED] (work),
[EMAIL PROTECTED] (play).  It's my opinion, I tell you! Mine! All MINE!
Size of 'diff -Nurw [...] winehq corel' as of Sat Feb 13 15:14:00 EST 1999
Lines/files:  In 10558 / 114, Out 6460 / 77, Both 14451 / 162

Reply via email to