Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • The best idea is stop thinking about heap and stack. They don't really exist in C++ (its a Java/C# construct).Think about lifespan (duration) of an object. Commented Jan 14, 2011 at 7:11
  • 2
    Waitaminute. The stack is a Java construct?! Definitely not. It's a C construct, if not older. But setjmp/longjmp made it very clear that C has a stack. Java on the other hand allows objects to escape function scope, which is why the stack concept there doesn't exists (wrt memory; exceptions are another matter) Commented Jan 14, 2011 at 8:47