I have a problem with function arguments. I have a function A which calls a function B. What do I have to write instead of ??? to archive that functionA passes all arguments to function B?
#include <iostream>
#include <stdarg.h>
void functionA(int a, ...);
void functionB(int a, ...);
int main()
{
functionA(2, 5, 13);
return 0;
}
void functionA(int a, ...)
{
functionB(a, ??? );
}
void functionB(int a, ...)
{
va_list params;
va_start(params, a);
for(int i = 0; i<a; i++)
{
std::cout << va_arg(params, int) << std::endl;
}
va_end(params);
}