"Program structure" and program structure of C ++
Variable typeI. global variables and local variables1. Scope of global variables: File Scope. 2. Scope of local variables: function scope, block scope, and function prototype scope.
Ii. Storage Type1. auto: the default storage type of local variables. 2. register: register variable types defined to improve execution efficiency. 3. extern: global variables shared by left and right modules. 4. static: The Global static variable type that can be used for the next call.
Program file structure and compilation preprocessing commandsI. File Inclusion # include command and macro definition1. Commonalities: both are pre-processing commands. The so-called pre-processing commands are the commands executed by the pre-processor before compilation. 2. Differences: Format: File Inclusion # include command: # include <included File Name> (use angle brackets for system-provided header files) or # include "included file name" (use double quotation marks for custom header files and source programs) macro definition: # define mark word string
Meaning:
File Inclusion # include command: to include all the content of another file.
Macro definition: Replace the identifiers with the same macro names in the source program with the macro content text, and do not perform any operations on the macro content text. In general, it only plays a role of replacement.
NamespaceI. Definition Format:Namespace name {member ;}
Ii. role:Place the same name in Different spaces, and each group is a namespace to avoid unnecessary name conflicts.