memory allocation doubt
Hi,
I'm not clear as to when memory is allocated from the stack, free store or data area.Can someone please elaborate?
AutoC
Junior Poster in Training
74 posts since Sep 2008
Reputation Points: 10
Solved Threads: 0
William Hemsworth
Posting Virtuoso
1,591 posts since Mar 2008
Reputation Points: 1,429
Solved Threads: 129
Definitely read the links provided above but the short answer to your question is that pointers point to data stored on the stack and everything else is on the program stack. But remember, the pointer is on the stack and the data it points to is on the heap. For a brief pointer overview see this site
http://coutblog.blogspot.com/2009/10/pointers-explained.html
For beginner programmers the only time they really need to worry about this is when they are using pointers.
chunalt787
Junior Poster in Training
84 posts since Apr 2008
Reputation Points: 39
Solved Threads: 1