-
(Variable Arguments,...)
Hi. I have two functions. They both take variable arguments lists. I want to merge the two into one. But is this possible?
I have not attempted anything yet but I just got the idea that maybe if the new function was set up to accept the first variable arguments till it reached a NULL then the remaining arguments would be for the second VA list?
Possible?
Thanks in advance for any input on this. :confused:
-
That is a very interesting situation. You can make more than one list in a function.
Code:
void whatever(char* something, ...){
va_list list1, list2;
// code
}
I'm not sure if that helps. If i were you I'd play with it and see what you can do.
-
Well I would like to call it from the program ...like this:
Code:
twoVAfunc(num, string, VA1a, VA1b, VA1c, NULL, VA2a, VA2b, VA2c);
...etc.
Anyway, I try out my NULL idea.
-
It's hard to tell exactly what you want from your post and pseudocode. Perhaps you should post the prototypes of the two functions you want to synthesize to give us a better idea about what you want to do.