Posted by Veitch Kyrie's Blog on August 24, 2020

[转]可变参数的宏定义

#include<stdio.h>

#define LOG(format, ...) printf(""format"\n",##__VA_ARGS__)

int main()
{
	LOG("%d %d %d",1,2,3);

	return 0;
}

输出结果

$ 1 2 3