/*
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)##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;
}

c语言中宏#和##作用_字符串拼接

参考: