There are 2 use of static keyword:
1. At the external level, it specifies the scope of the variable is limited to the file it is defined in it, it cannot be reference from another file
2. Inside a function definition, it means the variable should be allocated at a fixed location in memory, such that it retains its value beteen function calls.
The extern keyword allow you to declare what the variable are, but it does not create varibles or allocate memory for them.