Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language, storage type keyword?
C language, storage type keyword?
There are four storage type keywords as follows:

1 auto: declare an automatic variable.

This is the default value. auto int a; And int a;; Exactly the same. Therefore, the use of auto is generally not seen in programming.

2 extern: declare external variables.

The function is used to extend the range of global variables.

3 Registers: Declare register variables.

After declaration, variables are stored in CPU registers. Is the fastest C language variable.

However, it should be noted that CPU registers are limited, so not all variables declared as registers will exist in the registers. Using register is more like an application. Whether a register can exist or not depends on the system. Use this project as little as possible.

4 static: declare a static variable.

There are two kinds of static local variables and static global variables. When used for local variables, the variable declaration period extends to the whole program operation. When used for global variables, the scope of global variables is limited to this file.