Function pointer as the parameter
I followed the NAG example for optimation. The main function is:
void nag_opt_nlp(int n, int nclin, int ncnlin, double a[], int tda, double bl[], double bu[],
void (*objfun)(int n, double x[], double *objf, double g[], Nag_comm * comm),
void(*confun)(int n, int ncnlin, int needc[], double x[], double conf[], double conjac[], Nag_Comm *comm),
double x[], double *objf, double g[],
Nag_E04_Opt *options, Nag_Comm *comm, NagError *fail)
In the manual example, the call of the objective function 'objfun' is directly objfun, yet my compiler returns an error of:
error of parameter 8: can't convert void(int,double [],double *,double [], Nag_comm*) to void(_stdcall *)(int*, double*, double*,double*,Nag_comm*)
I really have no idea how to tackle this. Anyone can help? Many thanks!