The static has two major role in C:
1. Define local static variable, which holds the value through the whole process of the execution. The static variable is stored in heap instead of stack.
2. Prohibit the access of the variable from other files. When a variable is static, it can not be extern.
The static has an extra usage in C++:
1. The static can decorate class variable and class function. When a member variable of a class or a member function of a class becomes static, it does not belong to any specific instance of the class. It will be shared among all the instance of the class, which can be called class function or class variable.