Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

static anus

Name: Anonymous 2011-12-11 22:42

are variables declared in C headers static even if you don't put static with them?

Name: Anonymous 2011-12-12 12:26

>>7
No, the linker will allocate the storage only once and make all variables refer to it. Unless you declared it as `static`, in which case each compilation unit gets its own copy.

Though you are encouraged to follow the following pattern: declare the variable in the header as `extern`, then declare it normally exactly once somewhere where you also include the header. This prevents most of bad shit which could happen if the variable is declared with different types in different places.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List