1. Register
When a variable is defined within a function, the default is the auto type, the variable is stored in memory, and when the program uses that variable, the controller issues a command to send the value of the variable in memory to the operator, and then the data is sent from the operator to memory after the calculation is over. If a variable is decorated with the Register keyword, the compiler can store the variable in the internal registers of the CPU as much as possible, so that the variable is not accessed through memory addressing, which greatly improves access efficiency.
2. Volatile
Variable or address that is modified by the volatile keyword, the value of the variable or the value that the address points to is retrieved from memory each time it is used. If not modified with the volatile keyword, when the compiler optimizes, in the same process, when the last value of this address action is not changed in the process, he automatically fetches the last read data without re-fetching the contents from the memory address. This situation is often used in embedded systems, driver programming, and generally in the operation of registers or hardware I/O ports.
3. Inline
The inline keyword-decorated function is called an inline function, and at the time of program compilation, the compiler replaces the call expression for the function with the function body of the function as it appears in the program. Similar to macro replacement, but easier to understand than the macro, error-prone. The inline keyword is used to define functions that are short in function body code and frequently called, saving the time cost of frequent jumps of the function at the expense of increasing the target code.
4 、。。。。。。
C Language various keywords