How to pass variable args from a wrapper function to fprintf

Status
Not open for further replies.

hercules

Inactive
Contributor
Hello,

I was writing a function, which accepts a variable number of agrs, does some operations and may decide that it should act as a normal fprintf().

like logTofile(fileIP,char* format, ...)

Now when this function knows that it has to call a function like fprintf(), with all the variable args, is it possible to pass the variable arguments directly to that function , I mean by not reading those args first using va_arg ?
 
I dont think so.You will have to use va_arg(). But if anyone can propose an alternate solution it would be great.
 
yes, even i couldn't find any other method till now.
No response from any body, so may be its hard to find other way :huh:
 
In UNIX you can do so. You can pass variable number of arguments to a shell script and basis on your args you can have shell behave differently
 
Status
Not open for further replies.