Where are initialised global variables stored in a C program ?
Answer: C
Correct answer: The initialised data segment
Globals given an explicit non-zero value at compile time occupy the initialised data segment, and their values are part of the executable file. Globals left uninitialised go instead to the BSS, which the loader clears to zero.
Please log in or register to report this question.