C预处理器传递多个参数,就好像它们是单个参数一样.我非常确定问题是我们如何调用untouchable宏,但是我们为改变first宏所做的每一次尝试都未能产生预期的结果.这是一个包含注释的完整代码示例,用于解释发生了什么以及我们想要发生什么:
//this can be changed, but it must remain a #define to be of any use to us
#define first a,b,c
// v all code below this line cannot be altered (it's outside of our control)
#define untouchable(name, c1, c2, c3) \
wchar_t name[] = \
{ \
quote(c1), \
quote(c2), \
quote(c3) \
}
#define quote(c) L#@c
// ^ all code above this line cannot be altered (it's outside of our control)
int _tmain(int argc, …Run Code Online (Sandbox Code Playgroud)