C preprocessor Macro defining Macro

后端 未结 6 1222
耶瑟儿~
耶瑟儿~ 2020-12-29 01:49

Can you do something like this with a macro in C?

#define SUPERMACRO(X,Y) #define X Y

then

SUPERMACRO(A,B) expands to #define A B
<         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-29 02:11

    You could try running it through with only the preprocess option, then compiling with the preprocessed file.

提交回复
热议问题