What is the difference between these 2 declaration:
int operate(int (*func)(int, int), int a, int b){
return (*func)(a, b);
}
and
int operate(int func(int, int), int a, int b){
return func(a, b);
}
These two also seems to be equivalent: operate(sum, 1, 1)
and operate(&sum, 1, 1)
If I pass function sum
as a function of 2 numbers in the place of func
, the result are still the same. Why?