Possible Duplicate:
Where are static variables stored (in C/C++)?
I've read that all global variables that are initialized will be allocated space on the initialized data segment and all static and global variables that are not initialized are initialized to 0, and allocated on the BSS. In case of the following definition,
static int i = 0;
where will space for i
be allocated? Will it be on the initialized data segment because i
is initialized, or will it be on the BSS since the value of i
is 0?