Preprocessing command, preprocessing
1. All preprocessing commands start with #. There are three types of preprocessing commands: 1> macro definition: # define COUNT 4 // There is no symbol behind it # undef COUNT ends macro definition 2> Conditional compilation # define A 5 # if (A = 5) printf ("A is 5 "); # elifprintf ("A is 10"); # elseprintf ("A is another"); # endifreturn 0; # if defined () // if A is A macro definition 3> File Inclusion # include "lisi. h "in order to reduce the compilation efficiency caused by multiple file introductions, we recommend that you add # ifndef LISI_H // macro variable defined by file name # define LISI_H 123int sum (int a, int B) to each introduced file ); # endif3.1 <> indicates the file that comes with the system. "" indicates that custom file 3.2 cannot be contained cyclically, for example,. h contains B. h, while B. h also contains. h3: the pre-processing command is executed 4 before the code is translated into and 1. The pre-processing command is written at random. The pre-processing command ranges from the line where the command is written, until the end of the file is 6. macro names generally start with uppercase or k. Variable names generally have higher efficiency than macro definitions with parameters in lower case: # define sum (v1, v2) (v1) + (v2) # define pingfang (v1, v2) (v1) * (v2 ))