I understand in order to pass a function as arguments we need to make it a function pointer. But why do we need to pass function pointer as an argument in another function, while we can call the function in another function definition?
//Why this
int (*f1)(int);
int testFunction(int (*f)(int));
//Instead of this
int f1(int);
int testFunction()
{
int f1Value = f1(2); //call the fucntion and store the value
}
the example might mean nothing.
When we favor passing function pointer instead of just calling the function?