TL DR
"Function" and "function pointer" are the same.
There is the concept of a pointer and the syntax of its use; itβs not clear what you are asking for.
Concept
A pointer to a function may differ from the function itself (the difference is not useful in C ++ - see below) in that the function can take up a lot of space - its code can be arbitrarily complex. Manipulating (e.g. copying or searching / changing) function code is rarely useful, therefore c / C ++ does not support it at all. If you want to change the function code, hover over char* using all the necessary precautions (I never did).
So, if you write C, all you need is function pointers.
But...
Syntax
If you have a p pointer for a function, how do you want to call the function?
(*p)(18);
There is a slightly cleaner syntax that does not contain the * sign. To support it, the c / C ++ authors came up with the concept of "decay" - when your code mentions a "function", the compiler silently "fixes" it instead of a "pointer to a function" (in almost all cases; excuse me for not specifying Further). This is very similar to the "decay" of an array into a pointer mentioned by vsoftco.
So in your example
void runprint(int function(int x), int x) { cout << function(x) << endl; }
the type of function is actually the type of function pointer. Indeed, if you are trying to "overload":
void runprint(int (*function)(int x), int x) { cout << function(x) << endl; }
the compiler will complain about two identical functions with the same set of parameters.
Also, when creating a variable of type function / pointer-to-function
runprint(add, 1);
it also doesn't matter:
runprint(&add, 1);
PS When declaring a function that receives a callback, I basically saw (and used) an explicitly written pointer. It only occurred to me now that he does not agree to rely on decomposition of the function-to-pointer when calling the callback, but not when declaring my code. So if the question
why does everyone declare callbacks using pointer-to-function syntax when the function syntax is sufficient?
I would answer "out of habit."