C Preprocessor concatenation with variable [duplicate]
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: C preprocessor and concatenation Is it possible to concatenate a C preprocessor with a variable name? #define WIDTH 32 int dataWIDTH; // dataWIDTH should be interpreted as 'data32' printf("%d",dataWIDTH); 回答1: Your use case requires a double-unescaping; using the token pasting (##) operator by itself will just append the name of the preprocessor directive. #define WIDTH 32 #define _MAKEDATA(n) data##n #define