In C-like languages (C, C++, Objective-C etc.) you can't directly pass variadic arguments. However, you may (and if you're developing an external library, or you just want to facilitate the work of reverse engineers you should) supply a non-variadic version of your function, and make the variadic one just wrap it, so that you can pass down as many arguments as needed to your function -- using va_list. Example:
// variadic function
void variadic_func(int nargs, ...)
{
// just wrap the non-variadic one
va_list args;
va_start(args, nargs);
non_variadic_func(nargs, args);
va_end(args);
}
// non-variadic function
void non_variadic_func(int nargs, va_list args)
{
// do what you want with `args'
}
// you can pass down varargs like this:
void outmost_caller_func(int nargs, ...)
{
// since you can't pass down the `...', you create a va_list argument list
va_list args;
va_start(args, nargs);
// and call the non-variadic version of your function, just like the wrapper
// would do (anyway, the wrapper is only for convenience...)
non_variadic_func(nargs, args);
va_end(args);
}