Original Post
Hello all, In my game engine I found it necessary to have one class utilize the stdarg iterator found inside another class. I would like to pass the argument list as-is, without processing it (or specifically, without duplicating code unnecessarily), however my dilemma is I don't know how to pass the arguments. An example follows. I'm not really sure what keywords to google for this sort of thing, so I figured I'd ask here. Thanks :)
void do_stuff(char* str, ...)
{
char complete_str[2048];
// Compose the text string
va_list ap;
va_start(ap, str);
vsprintf(complete_str, str, ap);
va_end(ap);
}
void do_other_stuff(char* string, ...)
{
do_stuff(/* WHAT GOES HERE??? */);
}
int main(void)
{
char* str = "string";
do_other_stuff("this is a %s", str);
return 0;
}