void MyFunc(const char *fmt, ...)
{
va_list ap;
va_start(ap,fmt);
printf(fmt, ap); //should just print out what I pass it
va_end(ap);
}
This compiles just fine. I tested with this.
int num =5;
MyFunc("Num is %d\n", num);
I get "Num is 1235752" What is it giving me back? Obviously, my code is wrong. Is there a way to do this correctly? Thanks in advance.