【发布时间】:2012-06-14 16:13:35
【问题描述】:
给定
#define cat(x,y) x##y
调用cat(a,1) 返回a1,但cat(cat(1,2),3) 未定义。
但是,如果我还定义了#define xcat(x,y) cat(x,y),那么xcat(xcat(1,2),3) 的结果现在是123。谁能详细解释一下为什么会这样?
【问题讨论】:
-
你的意思是
then the result of xcat(xcat(1,2),3) is now 123? -
@notfed:对不起,我写错了。是的 xcat(xcat(1,2),3) 的结果是 123
标签: c-preprocessor