You don't actually *need* the weird declaration for the function pointer. The following is 100% valid C:
Code:
#include <stdio.h>
int foo(int x)
{
return x*x;
}
int bar(int func(int), int x)
{
return func(x);
}
int main(void)
{
printf("%d\n", bar(foo, 2));
return 0;
}
Code:
> gcc --std=c89 -Wall -pedantic blah.c
>
> ./a.out
4
>
Without looking too much into it I think the OP's problem was having
Code:
int derivatives(double f(double a), double x, double eps, double * d1, double * d2)
Rather than
Code:
int derivatives(double f(double), double x, double eps, double * d1, double * d2)
(not that in the first instance it names the parameter and in the second one that should work it only has the type