#include <iostream>
#include <cstdio>
#include <stdarg.h>
template<typename... Args>
void log(Args&&... args)
{
printf(std::forward<Args>(args)...);
}
#define macro_printf(...) printf(__VA_ARGS__)
void my_printf(const char *fmt,...)
{
va_list vaList;
va_start(vaList, fmt);
vprintf(fmt,vaList);
}
int main(int argc,char **argv)
{
log("1: 123 %d %f %s\n",456,789.123,"10,11,12");
macro_printf("2: 123 %f\n",456.789);
my_printf("3: this in function .... %s\n","hello world!");
return 0;
}
root@jeason:~/work/dynamicParams
1: 123 456 789.123000 10,11,12
2: 123 456.789000
3: this in function .... hello world!