Solved
Handling variable arguments.
Posted on 1999-11-16
I'm trying to find a solution to solve the following problem:
Input is the following:
1. a pointer to a function, possible form of the function is
double f(double)
double f(double,double)
double f(double,double,double)
double f(double,double,double,double)
... (to whatever)
2. an integer n telling me how many arguments the function need
3. n double numbers
4. an integer m telling me which double number I need to process
Output is:
f(...,value,...)
value is the processed double number
Summary:
The function should look like this
double Process(int n,int m,double f(?),...)
{
Read the double arguments
Process the mth argument
return f(...,value,...)
};
Can anyone help me?
I don't know if this involves assembly, but it does, please provide the possible solution for Win32 and Unix.
Thank you very much!