
vprintf/vsprintf with function calls as arguments?
Hi,
I have the following function:
void log(char * str, ...){
va_start(vararglist, str);
vprintf(buffer, str, vararglist);
va_end(vararglist);
Quote:
}
Now when I call
log("%d %d", 1, f(1));
where f is some function int f(int ), the second argument printed by vprintf
appears to be not the output of f(1). (Sorry for the roundabout explanation,
but this is a whittled down example of the real code.)
Is there a known problem with a call to vprintf(str, format), where format
contains calls to functions (such as f(.) above)?
i and a colleague gone over the code several times, and it doesn't make
sense that this is happening inside visual studio.
Thanks in advance.
Indranil