[C/C++] Passing va_args possible?

Hi there,
I just started using va_args for a function I made that works pretty
much like printf(char *format, …). Now, I have a need for more
than one of these functions and I was wondering if it was possible to
pass the (…) to the other function.

It’s just that my function is already pretty long and I would have
to repeat it for different uses (with very subtle variations) and i
would just like to pass the (…) to a central function that will do
the main work and then each of my functions can add their subtle
variations to it.

If it’s not possible, I’ll go another way, I was just wondering if
it was possible and how to do it.

Thanks,
Simon

I don’t really see how this is SDL-related, but you can just pass the
va_list to the central function.

– JoshOn 2/25/06, Simon <simon.xhz at gmail.com> wrote:

Hi there,
I just started using va_args for a function I made that works pretty
much like printf(char *format, …). Now, I have a need for more
than one of these functions and I was wondering if it was possible to
pass the (…) to the other function.

It’s just that my function is already pretty long and I would have
to repeat it for different uses (with very subtle variations) and i
would just like to pass the (…) to a central function that will do
the main work and then each of my functions can add their subtle
variations to it.

If it’s not possible, I’ll go another way, I was just wondering if
it was possible and how to do it.

I don’t really see how this is SDL-related, but you can just pass the
va_list to the central function.

Ok, yea, that’s a great idea! Didn’t think about it.

You’re right btw, it’s not SDL related, but my project is filled with
SDL and there may have been a SDL solution, we never know…

Thanks,
Simon