So I have a function with the prototype
double Solution::bisect
(
double xLeft,
double xRight,
double epsilon,
double f(double x, EquCoeffs coeffsStruct),
bool &error
);
where function f
is prototyped like this
double Solution::f(double x, EquCoeffs coeffsStruct);
The error I am getting in Visual Studio is argument of type "double(Solution::*)(double x, Solution::EquCoeffs coeffsStruct)" is incompatible with parameter of type "double(*)(double x, Solution::EquCoeffs coeffsStruct)"
which occurs when I try to call bisect(xLeft, xRight, epsilon, f, error);
where xRight
xLeft
epsilon
, are type double
and error
is type bool
.
Why won't this compile? I'm not sure I understand the error. How is a double(Solution::*)
different than double(*)
?