Can C/C++ preprocessor macros have default parameter values? [duplicate]
问题 This question already has answers here : Optional Parameters with C++ Macros (14 answers) Overloading Macro on Number of Arguments (8 answers) Closed 4 years ago . Can we specify default parameter values for macro parameters? I know there isn't any type-checking, so I expect the default value to be nothing more than just some text used by the preprocessor for macro expansion in instances where the parameter value is not specified. 回答1: You are looking for a macro overload mechanism which is