wrapper to a function with an unknown number of variables
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Hi, I want to write a wrapper to a function, which has a "..." argument declaration. For example: void foo(const char* format, ...) { printf(format, ??????)// what do I write here? } Any ideas? Thanks. /=/=/=/= Deus /=/=/=/=
You would include stdarg.h and use vprintf to do something like this:
void foo(const char* format, ...) { va_list args; va_start(args, format); vprintf(format, args); va_end(args); }