Global Variables

They can be used through tree different modifiers:

const

defines a constant variable on global scope. The compiler will pack those variables together with executable code into the text segment which is read-only protected by the operating system.

extern

an extern declaration makes a global variable defined in another file accessible in the file with the extern declaration. The c-module (file) declares that it will use the external variable in its code. After compilation it is the linkers responsibility to find the file with the global definition of the variable and "link" it together with the referencing code.

static

a variable declared as "static" is visible only within the file with the definition. All functions in this file can use the variable. The variable is NOT a stack (automatic) variable and will NOT cease to exist after a function call. (Same behavior as in Java)