Naming conventions for macro names
1. All caps have multiple words separated by underscores (commonly used)
2. The hump mark starting with K (not commonly used)
Macro definition with parameters: Place the name of the macro after the macro name in the parentheses after the argument into the expression after the macro, and then replace
Format: #define Macro name (argument list) expression
Note: 1. No type in the parameter list
2, the macro name and parentheses must not add space between
The difference between a macro and a function with parameters
1, the function has a call process, will open up new storage space, need to spend some overhead
2, the macro is only to do a replacement operation
Usage scenarios:
1, when the calculation is relatively simple, the parameters are less when the use of macros, macros to improve the efficiency of operations
2, when the logic is more complex, more parameters when using the function
The macro's note point:
1, if you do the problem, the macro is just to do a replacement operation
2, if you write the macro definition, then all the parameters and the results of the operation of the place to add parentheses
3, the macro has some inherent shortcomings is no way to eliminate, in the use of macros with parameters do not use the parameter + +--= =/= *=%=
C Language: Macro definitions with parameters