int foo ( int (*f)(int) )
{
return f(666);
}
This means that
foo
is a function returning an integer that takes a function
f
as a parameter.
f
will be a pointer to a function which returns an integer and which takes a single int parameter.
When calling a function with a function parameter, the value passed must be a pointer to a function. Just use the function's name (without parentheses) for this:
int myFunct(int x)
{
return x * 2;
}
...
printf("%u\n", foo(myFunct));