I have seen this definition of a function that receives a function pointer as parameter:
double fin_diff(double f(double), double x, double h = 0.01) {
return (f(x+h)-f(x)) / h;
}
I am used to see this definition with an asterisk, i.e.:
double fin_diff(double (*f)(double), double x, double h = 0.01);
Do you know why the first definition is also valid?