K
kj
I want to write a function foo that I can call with a variable list
of arguments, and so that all but the first n arguments are passed
by foo directly to printf. E.g., if n=3, calls to foo would look
like this:
foo( some, leading, args, "a format string with %d slot", 1 );
or
foo( also, suitable, params, "a %s with %d slots", "template", 2 );
and in these cases, foo at some point would execute calls to
printf( "a format string with %d slot", 1 );
and
printf( "a %s with %d slots", "template", 2 );
respectively.
Can someone show me (or point me to where I can learn) how to do
this?
TIA!
Kynn
of arguments, and so that all but the first n arguments are passed
by foo directly to printf. E.g., if n=3, calls to foo would look
like this:
foo( some, leading, args, "a format string with %d slot", 1 );
or
foo( also, suitable, params, "a %s with %d slots", "template", 2 );
and in these cases, foo at some point would execute calls to
printf( "a format string with %d slot", 1 );
and
printf( "a %s with %d slots", "template", 2 );
respectively.
Can someone show me (or point me to where I can learn) how to do
this?
TIA!
Kynn