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.

2
  • This is all implementation-dependent. In traditional Unix systems, the heap would grow down from the end of static memory, and the stack would grow up from the bottom of the address space. But there's nothing in the C spec. that requires this, and with modern multi-threaded implementations things aren't as simple. Commented Jun 19, 2016 at 0:37
  • If you want to test this on your system, try doing some tests: Write a program that prints the address of global initialized variable, a global uninitialized variable, some storage returned by malloc, and the address of an automatic (stack) variable. See how they fit into the address space. Commented Jun 19, 2016 at 0:39