From

xiaoxiao2021-03-06  61

Word Source VC World - C language classroom

Self-archiving, also dedicated to the same Delphi programmer as me

The so-called pretreatment refers to the work procedure before the first pass scan (lexical scanning and grammar analysis) is performed. Prerequisites are an important feature of C language that is done by the pre-processing program. When compiling a source file, the system will automatically reference the preprocessor to the pre-process part of the source program, and the processing is automatically entered into the source program.

The C language provides a variety of preprocessing functions, such as macro definitions, files, conditional compilation, and more. Programs prepared reasonably using programs to read, modify, transplant, and debugging, and also benefit modular programming. This chapter introduces several common pretreatment features.

1. Pre-processing functions are a unique function of C language, which is done by the pre-processing program before formally compiling the source program. The programmer calls these features in the program.

2. Macro definition is to represent a string with an identifier, which can be constant, variables, or expressions. This string will be replaced with this string in the macro.

3. Macro definition can be used with parameters, and the macro is used to change the parameters. Instead of "value transfer".

4. In order to avoid an error while the macro change occurs, the string in the macro definition should be plugged in parentheses, and the form parameters appearing in the string should also be added.

5. The file contains an important feature of the pre-processed, which can be used to connect multiple source files into a source file to compile, and the result will generate a target file.

6. Condition Compilation Allows only program segments that meet the conditions in the source program, so that the generated target programs are shorter, thereby reducing the overhead of memory and improving the efficiency of the program.

7. Use the preprocessing features to make the program's modification, reading, transplanting, and debugging, making it easy to implement modular programming.

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

New Post(0)