2 ms·
Both have so-called "static storage duration", which is what influences the initial value. See C99 standard, section 6.2.4 paragraph 4: "An object whose identi
by to3m 13y ago
Both have so-called "static storage duration", which is what influences the initial value. See C99 standard, section 6.2.4 paragraph 4:
"An object whose identifier is declared with external or internal linkage, or with the
storage-class specifier `static' has /static storage duration/. Its lifetime is the entire
execution of the program and its stored value is initialized only once, prior to program
startup."
The default initial value of objects with static storage duration is dealt with in 6.7.8 paragraph 10. Basically: pointers set to NULL, non-pointers have all bits reset, aggregates thus recursively.