define 中的##用来连接 ## 之前和之后的内容
#define aaa(arg) hello_ ## arg
int main(void)
{
int hello_i = 11;
printf("hello world, %d\n", aaa(i));
return 0;
}
预处理后:
int main(void)
{
int hello_i = 11;
printf("hello world, %d\n", hello_i);
return 0;
}
本文深入探讨了C语言预处理器中##操作符的功能与使用,通过具体代码示例,展示了如何利用##将两个参数连接成一个标识符,这对于宏定义和代码生成具有重要意义。
3万+

被折叠的 条评论
为什么被折叠?



