C语言 可变参数宏

来源:互联网 发布:网络教学的原则 编辑:程序博客网 时间:2024/04/29 23:16

就是参数个数不限定的宏

为什么需要?

格式化字符串

#elif defined WIN32#define LOGI(out,...) printf(out,##__VA_ARGS__);fflush(stdout)#define LOGE(out,...) printf(out,##__VA_ARGS__);fflush(stdout)#elif defined IOS

使用


LOGI("after %s() glError (0x%x) \n",op,error);


0 0