- 论坛徽章:
- 1
|
If a second level of macro definition is introduced<--- 这句话是在先用 #define xcat(x, y) cat(x,y) 展开吗?
用下面三段宏可以正常得到 123
#define cat(x, y) x ## y
#define xcat(x, y) cat(x,y)
xcat(xcat(1, 2), 3)
上面三段宏可以展开可以得到123 , 但我不懂的是下面两段宏展开之后
#define xcat(x, y) cat(x,y)
xcat(xcat(1, 2), 3)
会得到
cat(cat(1,2),3)
之后再用 #define cat(x, y) x ## y 宏把 cat(cat(1,2),3) 展开得到 123?
如果我这样跟直接用下面两段宏展开为什么就不行?
#define cat(x, y) x ## y
cat(cat(1,2),3)
下面处理展开步骤是怎样的可以说一下过程吗?
#define cat(x, y) x ## y
#define xcat(x, y) cat(x,y)
xcat(xcat(1, 2), 3)
谢谢 |
|