我知道你可以定义这样的函数:
#PRINT printf("hello world\n");
是否可以定义这样的函数?
#PRINT printf("hello world\n"), printf("hello stack\n");
(...该函数有两个步骤。)这可能吗?
最佳答案
感谢以上评论。我找到了问题的答案。
要定义具有多个步骤的宏,您需要执行此操作
#define FOO {\
printf("hello world\n");\
printf("hello stack\n");\
}
调用 FOO 将执行这两个打印语句。
关于c - 定义具有多个步骤的函数宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55564685/