reviewed the preprocessing and variable types today
The preprocessing is divided into three kinds: macro definition, conditional compilation, file contains three kinds of combination in the header file, you can prevent the content in the header file to be contained repeatedly.
Variable has its scope and life cycle: by scope, divided into global variables and local variables, the global variable by default is extern, can be used for all file access, local variables can only be accessed within the function. According to the different storage location, can be divided into static variables, automatic variables, register variables, static variables stored in memory, only for the current file access, automatic variables stored in the stack, when the function call is complete destruction, register variables are stored in the register, you need to use register decoration.
The extern, static keyword relates to a function variable:
The default is extern when the function is declared, and can only be accessed within the current file with static modification. Variables are also divided into definitions and declarations, and we often say int a, which uses definitions and declarations, but is only declared when using extern int A, and other things are like functions
2014.12.9 C Language Review