-
sprintf-like function
Hi guys,
I need to write a wrapper for sprintf which accepts an arbitrary number of inputs (like sprintf does) and then pass these on to the wrapped sprintf function itself.
How do I do this without using sprintf outside the function? Something like:
Code:
void do_somthing( const char *str, ...zero_or_more_inputs...){
char buff[BUFFER_SIZE_MAX];
// pass vars on to sprintf
sprintf( buff, str, ...zero_or_more_inputs...);
// use buffer
use_buffer( buff );
}
Cheers,
Pea
-
-
Thanks!
This was the eventual direct link: http://www.eskimo.com/~scs/C-faq/q15.5.html