Possible Duplicate:
Where are static variables stored (in C/C++)?
I am wondering where global variables and static variables are stored in C/C++. as far as local variables are stored in stack when function is active we also request memory from heap but I have no clue about static and global variables. Could any one please throw light on it.
When loading an executable, the operating system allocates memory for the global data of the program. Usually they are kept in the
.dataand.bsssections of the executable.