C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-02-2005, 06:00 PM   #1
C/C++
 
homeyg's Avatar
 
Join Date: Nov 2004
Location: Louisiana, USA
Posts: 209
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?
homeyg is offline   Reply With Quote
Old 06-02-2005, 06:13 PM   #2
Registered User
 
Codeplug's Avatar
 
Join Date: Mar 2003
Posts: 3,888
>> Is this true?
No. If you allocate an array using new, you must use delete[].

Perhaps you're thinking of sizeof(array)...

gg
Codeplug is offline   Reply With Quote
Old 06-02-2005, 06:21 PM   #3
C/C++
 
homeyg's Avatar
 
Join Date: Nov 2004
Location: Louisiana, USA
Posts: 209
Quote:
Originally Posted by Codeplug

Perhaps you're thinking of sizeof(array)...

gg
That's what I was thinking of! Thanks for reminding me.
homeyg is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help on understandind arrays C++mastawannabe C++ Programming 9 06-16-2007 10:50 PM
delete and delete [] Lionel C++ Programming 8 05-19-2005 01:52 PM
Which comes first...delete [] or NULL? Waldo2k2 C++ Programming 13 08-09-2002 09:05 AM
Problem need help Srpurdy C++ Programming 1 07-24-2002 12:45 PM
memory management... master5001 Game Programming 24 01-07-2002 05:50 PM


All times are GMT -6. The time now is 01:49 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22