Declaring a function or global variable static restricts its scope to the file it is defined in. In other words a static function or global variable can only be referenced by functions in the same file.
Declaring a variable within a function static causes the variable to be initialized at compilation time, and it will therefore retain its value between function calls.
Declaring a function prototype or global variable extern introduces that function or variable into the local file when it is defined or declared in a seperate file.
Comment