C Memory Areas
Memory Area Notes
Const Data Stores string literals and other data whose values are known at compile-time. All data is available during the lifetime of the program and is read-only.
Stack Stores automatic variables. Objects are constructed immediately at the point of definition and destroyed immediately at the end of the same scope. Stack memory allocation is much faster than for dynamic storage.
Free Store Dynamic memory area allocated/freed by new/delete.
Heap Dynamic memory area allocated/freed by malloc() / free().
Global / Static Global or static variables and objects have their storage allocated at program startup, but may not be initialized until after the program has begun executing.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.