, , printf accept, - , . printf ( ):
void varargfunc(char *fmt, ...)
{
char formattedString[2048];
va_list arguments;
va_start(arguments, fmt);
vsnprintf(formattedString, 2048, fmt, arguments);
puts(formattedString);
va_end(arguments);
}
If you want to add additional arguments that are not format related, add them before the 'fmt' argument. Fmt is passed to va_start to say "variable arguments begin after that."
source
share