2

What is the right way to implemet a function with this declaration:

void variadicFunction(int (*someFunction)(), ...)

such that it will call the function:

someFunction(...)

where ...are the variadic parameters given to variadicFunction. Thank you.

ameyCU
  • 16,489
  • 2
  • 26
  • 41
omrikap
  • 135
  • 1
  • 8
  • 2
    What is the full prototype of someFunction? You are omitting parameters, which is a dangerous obsolete variant. – this Aug 22 '15 at 13:51
  • Unfortunately, this is not possible. You need to rewrite `someFunction` to receive a `va_args` instead. – fuz Aug 22 '15 at 14:04
  • I wanted to make a general driver function for a specific project's unit testing. Thanks for the answers. – omrikap Aug 22 '15 at 14:26

0 Answers0