Hi all,

In C/C++ it is possible to create a function that takes a variable number of arguments using the va_list type found in stdarg.h. These arguments can be used as input for the function.

Does anybody know if it is possible to create a function where a variable number of arguments can be used as output. So that each of the arguments gets a new value assigned. I would like to create something like this:

Code:
void   CopyResult(int numberArgs, ...) { 
   va_list   argp; 
   va_start(argp, numberArgs); 
   for(int i = 1; i < numberArgs; i++)  { 
      //assign argument 'i' here 
      ..... 
      va_arg(argp, int);  } 
   va_end(argp); 
   } 
}
Using an array is not possible for me. Since I plan to extend the function to not only take a variable number of arguments but also variable types.