This question already has an answer here:
What's the meaning of "##" in the following?
#define CC_SYNTHESIZE(varType, varName, funName)\
protected: varType varName;\
public: inline varType get##funName(void) const { return varName; }\
public: inline void set##funName(varType var){ varName = var; }
The operator ## concatenates two arguments leaving no blank spaces between them: e.g.
#define glue(a,b) a ## b
glue(c,out) << "test";
This would also be translated into:
cout << "test";
It concatenates tokens without leaving blanks between them. Basically, if you didn't have the ## there
public: inline varType getfunName(void) const { return varName; }\
the precompiler would not replace funName with the parameter value. With ##, get and funName are separate tokens, which means the precompiler can replace funName and then concatenate the results.
This is called token pasting or token concatenation.
The ## (double number sign) operator concatenates two tokens in a macro invocation (text and/or arguments) given in a macro definition.
Take a look here at the official GNU GCC compiler documentation for more information.
来源:https://stackoverflow.com/questions/18031280/whats-the-meaning-of-in-a-c-macro