xcode: Allocated memory freed upon C++ program end?

Joined
Feb 1, 2011
Messages
4
Reaction score
0
Points
1
hello everyone,

I am using xcode 3.2.5 on Mac OS X 10.6.6 and programming in C++.

I am just learning about dynamic memory allocation with arrays and I realize that using the code:

delete [] <arrayname>;

after using "new" to allocate memory is important for freeing up the allocated memory when finished with it but I am wondering if someone (say me) DIDN'T use the delete code and ran the program (say a bunch of times) before knowing to use delete, was the allocated memory automatically freed when my program terminated each time?

Or did I just block off a bunch of memory that now can no longer be used (until I learn someway to free it)????

Thanks everyone!

-Ben
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top