(1) In the function body, the local static variable. The lifetime is the entire life cycle of the program, but the scope is within the defined function body. A variable declared as static maintains its value in the process of the function being called. Because it is allocated in a static storage area, the function call does not release the unit after it is finished, but it cannot be accessed at other scopes. When this function is called again, the local variable survives and is used in its access space, so it accesses the value after the last call.
(2) within the file module but outside the function body, a global variable declared as static can be accessed by all functions within the module, but not by other functions outside the module, which is a local global variable that restricts the scope of the static global variable.
(3) Within a file module, a function defined as static can only be called by other functions within the module. In other words, this function is limited to the use of this file module, the function is a global function by default, can be called by any other file module.
The role of static in C language