Types of variablesfirst, global variables and local variables1, the scope of global variables: file scope. 2, the scope of local variables: function scope, block scope and function prototype scope.
second, storage type1, Auto: The default local variable storage type. 2. Register: The type of register variable that is defined to be removed directly from the register in order to improve execution efficiency. 3. Extern: Global variables common to the left and right modules. 4, Static: The type of global static variable that can be used the next time it is called.
program file structure and compile pre-processing commandsOne, the file contains #include命令与宏定义1. Common denominator: Both are preprocessing commands, so-called preprocessing commands are commands that are executed by the preprocessor before compilation. 2, different points:format:The file contains the # include command: #include < included file name > (use angle brackets for system-supplied header files)or #include "included file name" (use double quotation marks for your own defined header file and source program)macro definition: #define Identifier word string
Meaning:
The file contains the # include command: Contains the entire contents of another file.
Macro definition: Replaces the content text of macro with the same identifier as the macro name in the source program, and does nothing about the content text of the macro, but in general it is just a substitution action.
name SpaceFirst, define the format:namespace name {member;}
second, the role:Place the same name in a different space, and each group is a namespace, avoiding unnecessary name collisions.
C + + 's "program Structure"