Ponters to function and to member function

Hi,
I'm using GSL libraries to solve a system of ODE.
To set the system, the code is like this:

gsl_odeiv_system sys = {func, jac, size, parameters}

where "func, jac" are pointer to function.

I want to create a class "Sistema" that contain the system.
So, I created the function func and jac in this class.
So, pointer to these function (func and jac) are pointer to functions of the class Sistema (member function pointer), and for this reason they are incompatible with simple pointer function.

If I want to use gsl_odeiv_system sys = {func, jac, size, parameters}
I need function pointer, but in the class I have member function pointer.

How can I pass member function pointer to sys?

Thanks

How can I pass member function pointer to sys?
You probably shouldn't.

The difference between a normal pointer to a function and a pointer to a member function is that the member function expects to be passed the this pointer.

If you're working with a C function, it won't know about the C++ this pointer.
Topic archived. No new replies allowed.