/*
1.宏定义中使用#或##作用
2.宏定义函数使用
*/
1.#把语言符号转字符串
2.##字符串拼接
#include <stdio.h>
#define P(a) printf("%s,%d\n",#a,a);
#define SQR(X) printf("the "#X" is %d\n",((X)*(X)));
#define XM(n) x##n
int main()
{
int b = 3;
P(b);
printf("==================\n");
SQR(12);
printf("==================\n");
int x7 = 120;
printf(" == %d\n",XM(7));
while(1);
return 0;
}
参考:
https://www.cnblogs.com/castor-xu/p/12822802.html
https://blog.csdn.net/ce123_zhouwei/article/details/8961518