Yes it is possible, but instead of
printf
you should use
vprintf
. Look at the code snippet below:
void printfLn(const char *format, ...)
{
va_list args;
va_start(args, format);
vprintf(format, args);
printf("\n");
va_end(args);
}
For more details see
vprintf documentation[
^] and
access variable-argument lists[
^]