So I have a function in C++ which takes in another function:
double integral(double (*f)(double x){...};
I also have a class which has a member function f:
class Test{
public:
double myfun(double x){...};
};
I want to be able to call the integral function using the member function myfun of class Test. Is there a way to do this? For example, is it possible to do the following:
Test A;
integral(A.myfun);
I would even like to take this further and call integral within class Test, using its own member function as input!
Thanks!
integralfunction your own? Can you make modifications to it, to accept other types?