static
The static storage class limits the scope of a variable and changes the lifetime of local variables. It is used as follows:
static data-type name « = value »;
Where
| data-type | is the data type of the variable. |
| name | is the name of the variable. |
| value | is the value to assign to the variable. |
When you use static to declare a variable outside a function, that variable cannot be accessed outside the source file in which it is declared.
When you use static to declare a variable inside a function, that variable is initialized at startup (like other global variables) and retains its value between calls to that function. It is not reinitialized on entry to the function.