Yes:
va_list args; va_start(args, text); vprintf(format_goes_here, args);
You can find information on vprintf here (or check your manual pages).
I did the same for wrapper functions like write (Unix) and OutputDebugString (Windows) so that I could create a formatted string to pass them using vsnprintf .
EDIT: I misunderstood your question. No, you cannot, at least not in C. If you want to pass a variable number of arguments, the function you call must accept the va_list argument, as vprintf does. You cannot pass your va_list to a function like printf(const char *fmt, ... ) . This link contains additional information on this topic.
If the function accepts the va_list argument, then you can pass arguments from a specific point (i.e. you can skip the first). Returning the arguments with va_arg will update the va_list pointer to the next argument, and then when you pass va_list to a function (e.g. vprintf ), it can only retrieve the arguments from this point on.
source share