1

I want to develop a c function with random number of arguments:

int myfunction(char *fmt,...) {
....
}

then in my function I want to call printf() with the same input arguments of my function (the fmt and the other random arguments):

int myfunction(char *fmt,...) {
    ....
    printf(/*What I have to put here?*/)
    ....
}

How I can call printf() in this case?

MOHAMED
  • 41,599
  • 58
  • 163
  • 268
  • 1
    You will probably need to use `vprintf()` in this case, along with `va_start()`, `va_arg()`, etc... – twalberg May 21 '14 at 17:09
  • Not to mention [Passing variable arguments to another function that accepts a variable argument list](http://stackoverflow.com/questions/3530771/passing-variable-arguments-to-another-function-that-accepts-a-variable-argument/3530807#3530807) or [Forward an invocation of a variadic function in C](http://stackoverflow.com/questions/150543/forward-an-invocation-of-a-variadic-function-in-c). – Jonathan Leffler May 21 '14 at 17:12

0 Answers0