Hi, I'm trying to write a function that accepts a variable number of parameters like printf, does some stuff, then passes the variable list to printf. I'm not sure how to do this, because it seems like it would have to push them onto the stack.
Something approximately like this
#include <stdio.h>
#include <stdarg.h>
void forward_args( const char *format , ... ){
va_list arglist;
printf( format, arglist );
}
int main (int argc, char const *argv[]){
forward_args( "%s %s\n" , "hello" , "world" ); return 0;
}
Any ideas?