C language learning summary a variable type

xiaoxiao2021-03-06  47

C language variable level

Auto

Static

EXTERNAL

Static External External

Register

AUTO partial variable

The AUTO variable is to use the reservoir space with the stack. Therefore, when this section is performed, the system will immediately assign a memory space for this variable, and after the program is executed, this stack is immediately recovered. Declared in the braces {}.

Static static variable

The Static variable is the C program compiler to secure the address, as long as the program is not over, the memory is not released.

External variable

External variables are defined outside the program, all functions can be used very programs.

External variables may be redefined in a block, with the parameter variables as a reference value.

Static External variable

Static external variables and external variable differences are that external variable life can be used to multiple files simultaneously, while static external variables can only be used by files that declare this variable.

REGISTER variable

Register variables are allocated by registers, access speed is fast than access, speed up the speed. The register is limited.

转载请注明原文地址:https://www.9cbs.com/read-59082.html

New Post(0)