when you define a name with parameters, spaces are not allowed between the opening parentheses of the parameter list for a predefined name.
The general form of a macro definition with parameters is as follows: #define < macro name > (< parameter table >) < macro body >
where < macro name > is an identifier,< parameter table > parameter can be one or more, depending on the case, when there are multiple parameters, each parameter is separated by commas. < macro body > is the replaced string, and the string in the macro body is an expression that consists of the parameters in the parameter table. For example:
#define SUB (A, A, b) a
If the following statement appears in the program:
Result=sub (2, 3);
is replaced by the following:
result=2-3;
If the following statement appears in the program:
result= SUB (x+1, y+2);
is replaced by the following:
result=x+1-y+2;
In such a macro substitution process, in fact, only the parameters in the parameter table into the expression of the macro body, in the example above, that is, the expression of A and B in the 2 and 3 respectively into.
We can see that the macro definition with a parameter is similar to a function. If we treat the arguments that appear when the macro is defined as formal parameters, the parameters that appear when the macro definition is referenced in the program are treated as arguments. Then A and B in the example above are formal parameters, while 2 and 3 and x+1 and y+2 are arguments. When you replace a macro, it replaces the formal parameter in the < macro body > with an argument.