You can't do that. A member function (that isn't declared static
) has a special/hidden argument of this
. If you have an object of the correct type, you can pass that along with the function, and call it using the obscure syntax needed for member function calls:
double chordL(power* tp, double (power::*fm)(double), double p1, double p2)
...
(tp->*fm)(p1);
double power::execute(double par1, double par2){ // it's a member function
double (power::*g)(double);
g=&power::fun;
return chordL(this, g,par1,par2);
}
Edit: added calling code, passing this
to the chordL function, and swapped the order of the object and the function pointer from previous post - makes more sense to pass this
as the first argument. And I fixed up the function pointer argument.