On 27 Mar 2007 06:33:20 -0700, Gerald K Dunn Iii <[EMAIL PROTECTED]> wrote:
> Greetings. I understand how to pass a variable number of arguments to a
> function using the ellipsis and to access those variables in that function.
> However, it is unclear to me how to forward those values on to another
> function expecting a variable number of arguments.
>
> Although the syntax is incorrect, i believe this example should detail my
> problem:
>
> void DoStuffThenPrint(char *format, ...) {
>    // do stuff
>    printf(format, ...);
> }

vprintf() is the equivilant function in this context.

> I attempted to google this but was not creative enough to formulate a search
> criteria returning anything related.

The search term you're after is 'varargs,' and the 2nd match is
http://www.eskimo.com/~scs/cclass/int/sx11b.html which will probably
answer your current questions and stir up more.

> I thought I did see somewhere that '##'
> might be used to accomplish this scenario although its use was unclear to
> me. Any help would be greatly appreciated. Thank you.

## is usually only used in macro substitution at compile time - what
you're asking about happens at run-time.

-- 
PJH
Aio, quantitas magna frumentorum est

Reply via email to