Static
Role:1, Internal link assignment (limit global variables or functions to be available within this file)
2. Change the life cycle of local variables (so that local variables are stored in the static zone and released at the end of the program)
3. When defining a variable, add the static prefix, and the defined variable is initialized to 0 by default;
extern:1. Specify external links (make global variables or functions available within other files)
2. Tell the compiler that variables or functions declared by extern are within other files)
3, we know that if within a file if a global variable and a local variable name is the same, then in the local variable within the code block, we prefer to use local variables, but after the addition of extern is represented by the global variable.
Volatile: generally used with const, for example: int const a=10;
Because the const is added, the compiler will "optimize" A as a constant and store a on the stack. volatile int const a=10, plus volatile, tells the compiler not to optimize a for constants, so a can be modified in this case.
This article is from the "11132019" blog, please be sure to keep this source http://11142019.blog.51cto.com/11132019/1760087
static extern volatile