Hi everyone,

I am trying to write a generalized function to numerically solve a set of n simultaneous equations in n unknowns, for any integer n. I'd like to pass the individual equations as function pointers to a variable length argument list, like this

The next n arguments will be pointers to the variables, and the next n after that will be pointers to the functions. I'm planning to have va_arg stick them in an array of function pointers inside solve_simul. If n was 3, the function call would be equivalent toCode:void solve_simul( int n, ... ) {/*stuff*/}

where each of the phi functions (in the case where n=3) would be like this:Code:solve_simul( 3, &x, &y, &z, phi0, phi1, phi2 );

My problem is how to declare the function pointers inside the solve_simul function. It doesn't know beforehand how many variables the phi functions take, so how can I specify what type they are?Code:double phi0( double x, double y, double z ) {/*stuff*/}