Is it possible to transfer list of parameters of a function , to another function?
For example in my functionA I want to call my functionB/functionC (depends on the state of execution) with the parameters from the varargs list. Please note, i cannot change functionB/functionC declaration.
int functionA(int a, ...){
...
va_list listPointer;
va_start( listPointer, a);
...
}
int functionB(long b, long c, long d){
...
...
}
int functionC(long b, int c, int d){
...
...
}
For this project I use gcc 4.9.1.
What i have tried till now is to pass the void* from the listPointer but it did not work...
Extracting variables from the va_list also will not work because i have like 80 other similair functions which should be called from the functionA , meaning i cannot extract parameters and call by extracted values.
Maybe there is a way to copy memory of the functionA parameters and call functionB/functionC with a pointer to it? Does anyone have an idea of how it would be possible?