#define A(x) x;x;x;x;x;x;x;x;x;x;
A(printf ("%d ", n++));
就等价于
printf ("%d ", n++);printf ("%d ", n++);printf ("%d ", n++);printf ("%d ", n++);printf ("%d ", n++);printf ("%d ", n++);printf ("%d ", n++);printf ("%d ",n++);printf ("%d ", n++);printf ("%d ", n++); (1)
A(A(printf ("%d ", n++))); 等价于 (1) 重复10遍。也就是100次的printf了,
A(A(printf ("%d ", n++)))); 也就是A(printf 100次)也就是printf 1000次了
如果不理解,说明对宏理解不透彻了
那些都是在编译时候做宏展开的。你可以试试
A(A(A(A(A(printf ("%d ", n++))))));
这就是print100000次了,不过如果这样用,编译可能就“卡死”了,宏展开耗掉大量的时间