– static: global variable storage, permanent for the entire run of the program.
– stack: local variable storage (automatic, continuous memory).
– heap: dynamic storage (large pool of memory, not allocated in contiguous order).
STACK MEMORY
It’s a LIFO, “Last-In,-First-Out”, structure. Every time a function declares a new variable it is “pushed” onto the stack.
Reference:
https://blog.gtwang.org/programming/memory-layout-of-c-program/
https://craftofcoding.wordpress.com/2015/12/07/memory-in-c-the-stack-the-heap-and-static/
No comments:
Post a Comment