I have following function with only a variable parameter list (Without supporting/fixed argument). Is it possible to get values passed to this function? I am using ANSI format.
Foo( ... )
{
}
Adding some more points for clarity. In my special case, the number of arguments and their types are stored in a .xml file as configurations which can be accessed from Foo().
Edit:
I am adding some information from my trial and error. I partially succeeded to get data from list as follows.
va_list Arguments;
Arguments = (( va_list ) &Arguments + Offset );
Data = va_arg( Arguments, Type );
Idea I put behind this is directly reading data from stack. Here the problem factor is Offset whose value is varying according to the number of arguments I am passing into Foo(). For example, when I am passing a pointer only, I put its value as 16 to get correct result. I found this values with trial and error. I want to derive Offset from parameter list that my program can run without any runtime failure in all possible cases. Can someone tell me the relation between this Offset and the parameter list.
I am using Visual Studio 2008 for developing this.