HEAP AND STACK
Our program when loaded in to main memory is divided in to 4segments :CODE,DATA,STACK,HEAP
Adata segmentcontains the global variables and static variables.
Acode(text) segmentcontains the executable instructions.
AStack segmentstore all theauto variables. Also each function call
involves passing arguments from the caller to the callee. The calleemay also declare variables. Function parameters ,return addressand
local variablesare accommodated in the stack.
is an area of memory for storing data temporarily.