does always global variables are initialised to 0?
if not how to initialise an array to zero value in the global..
Printable View
does always global variables are initialised to 0?
if not how to initialise an array to zero value in the global..
Yes, global variables are initialized to zero (even static variabels).
Pedantics:
As patil states, global variables and static variables (they are global in all aspects except for where they are visible) are initialized to zero if they are not otherwise initialized.
--
Mats
then what is the difference between bss and initialised segments?