Many times we don't understand stack, heap and where global and static data are stored.
A very nice explanation for understanding the C program structure in memory:
http://www.geeksforgeeks.org/memory-layout-of-c-program/
A very nice explanation for understanding the C program structure in memory:
http://www.geeksforgeeks.org/memory-layout-of-c-program/