#define xstr(s) str(s)
#define str(s) #s
#define foo 4
int main(void)
{
/* ... */
printf("%s\r\n",str(foo));
printf("%s\r\n",xstr(foo));
下面这句话没看懂
宏调用xstr(foo)扩展为4,因为在str()中使用s时,s是字符串化的,因此它不是首先进行宏扩展的。但是,s是xstr()的一个普通参数,因此它在xstr()展开之前是完全宏展开的。因此,当str()到达其参数时,它已经被宏扩展。
--
FROM 120.35.11.*