19 Feb
2011
19 Feb
'11
22:10
On Sat, 2011-02-19 at 11:21 +0100, Per Jessen wrote:
What is the best/correct way of counting the number of args in vararg call:
int function( int blah, ... )
I've been googling a bit, and came across mentions of "vscprintf", in particular this alternative:
#define vscprintf(f,a) vsnprintf(NULL,0,f,a)
This tells you how many characters would have been copied into the destination string, had there been one. It does not tell you how many arguments there were. Only f (the format string) can do that, and then only by trusting the calling function that it's actually correct Anders -- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org