How can I wrap a function with variable length arguments?
The problem is that you cannot use ‘printf’ with va_args. You must use vprintf if you are using variable argument lists. vprint, vsprintf, vfprintf, etc. (there are also ‘safe’ versions in Microsoft’s C runtime that will prevent buffer overruns, etc.) You sample works as follows: void myprintf(char* fmt, …) { va_list args; va_start(args, fmt); vprintf(fmt, … Read more