944,086 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 382
  • C++ RSS
Oct 6th, 2009
0

memory allocation doubt

Expand Post »
Hi,

I'm not clear as to when memory is allocated from the stack, free store or data area.Can someone please elaborate?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
AutoC is offline Offline
74 posts
since Sep 2008
Oct 6th, 2009
0
Re: memory allocation doubt
Heap Memory: [link]
Stack Memory: [link]
Reputation Points: 1429
Solved Threads: 129
Posting Virtuoso
William Hemsworth is offline Offline
1,542 posts
since Mar 2008
Oct 6th, 2009
0
Re: memory allocation doubt
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...explained.html

For beginner programmers the only time they really need to worry about this is when they are using pointers.
Reputation Points: 39
Solved Threads: 1
Junior Poster in Training
chunalt787 is offline Offline
84 posts
since Apr 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Creating header file
Next Thread in C++ Forum Timeline: Replacing vector val and delaration help.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC