c语言第九章习题(国外英文资料)
c语言第九章习题(国外英文资料)
Chapter 9: pretreatment
pretreatment
An overview of the
In the previous chapters, you've used the preprocessor command that starts with the #. For example, include command # include, macrodefine command # define, etc. These commands are outside the function in the source program, and are generally placed in front of the source files, which are called preprocessing parts.
Preprocessing refers to the work that was done before the first scan of compilation (lexical scanning and parsing). Preprocessing is an important function of the C language, which is done by the preprocessor. When to compile a source file, the system will automatically referenced preprocessor preprocessing part of source program in processing, processed into the compilation of source code automatically.
The C language provides a variety of preprocessing functions such as macros, file inclusion, and conditional compilation. The proper use of preprocessing functions for easy reading, modification, migration, and debugging also facilitates modular programming. This chapter introduces several common preprocessing functions.
Macro definition
In the C language source program, an identifier is allowed to represent a string, called "macros". The identifier defined as "macros" is known as the "macro name". During the compilation of pretreatment, the program "macro", all in all with the string to substitution in the macro definition, which is referred to as a "macro substitution" or "macro expansion".
The macro definition is done by the macro definition command in the source program. The macro substitution is done automatically by the preprocessor. In the C language, macros are divided into parameters and parameters. The definitions and calls of these two "macros" are discussed below.
No arguments macro definition
No parameters are taken without the macro name of the macro. The general form of the definition is the # define identifier string where the "#" indicates that this is a preprocessin