I have a function as below
extern "C" int FuncTrace(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
return printf(fmt, args);
}
If I print some thing on console as below, it does not work?
FuncTrace(" %s \n", __PRETTY_FUNCTION__ );
Can someone help me correct the FuncTrace() ?
You need the vprintf
function if you want to pass in a va_list
pseudo-argument:
return vprintf(fmt, args);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With