Memory allocation in C++

1 view
Skip to first unread message

Kon V

unread,
Oct 26, 2011, 12:54:26 AM10/26/11
to SJSUcmpe130
Hi,
I was hoping somebody might be kind enough to give me a quick run down
memory allocation and reallocation in C++. When should memory be
allocated/reallocated/deleted? I've ran into memory issues on the last
assignment with huge amounts of data, and while some of it is most
likely due to my own system's limitations, I also feel like I'm not
doing properly myself.
Should I call delete on everything involving pointers?

Frank (sjsu) Lin

unread,
Oct 26, 2011, 7:30:04 PM10/26/11
to kvysh...@gmail.com, SJSUcmpe130
try wiki "dynamic memory allocation"

In fact, it has little to do with pointers, but with "new".  Just that new returns a pointer to the dynamic object.  You want to de-allocate object when it is no longer needed.
Reply all
Reply to author
Forward
0 new messages