I remember reading somewhere that if you send the address of a dynamic array to a function, using delete [] array; does no good because it doesn't keep track of how long the array was. Is this true?
This is a discussion on delete [] within the C++ Programming forums, part of the General Programming Boards category; I remember reading somewhere that if you send the address of a dynamic array to a function, using delete [] ...
I remember reading somewhere that if you send the address of a dynamic array to a function, using delete [] array; does no good because it doesn't keep track of how long the array was. Is this true?
>> Is this true?
No. If you allocate an array using new, you must use delete[].
Perhaps you're thinking of sizeof(array)...
gg
That's what I was thinking of! Thanks for reminding me.Originally Posted by Codeplug