[ad_1]
I am aware it is generally not possible to forward variadic arguments from one variadic function to another:
Forward an invocation of a variadic function in C
http://c-faq.com/varargs/handoff.html
My question is, is it possible if I know the number of variadic args in the callee? For example, can f_wrapper be written to pass … arguments to f?:
int f_wrapper(int argc, ...){
/* argc is the number of variadic args f_wrapper is called with. Can it be used to call f? */
/* Example: f_wrapper(3, "arg1", "arg2", "arg3"); */
}
int f(...){
/* f must be called with all ... args from f_wrapper. */
/* Adding signature with va_list is NOT allowed. c++ is NOT allowed */
}
[ad_2]