One, the code length: the macro is completely replaced, inserted into the program to make the code longer;
The function code is only present in one place and is used when it is called.
Second, the implementation speed: macro faster, because in the pre-compilation phase has been completed;
The function is slower because of the need to call and return (stack/stack) extra time.
Third, operator priority: macros sometimes need less parentheses to cause the calculation logic error;
The function finally returns only the value, and the result is easy to predict.
Four, the parameter evaluation: the macro every time to calculate;
The function only needs to be evaluated once, and subsequent calls do not result in multiple evaluation errors.
Five, the parameter type: the macro does not care about the type, as long as the parameter operation is valid;
function types are consistent, and different types require different functions.
The difference between macros and functions in C language