I\'d like to understand what is the difference between the 2 declarations, f1
and f2
, below:
In f1
I declare the parameter to be a pointer
In both C and C++, if you declare a function parameter to have function type, its type will be adjusted to function pointer.
C99, §6.7.5.3/8
A declaration of a parameter as ‘‘function returning type’’ shall be adjusted to ‘‘pointer to function returning type’’, as in 6.3.2.1.
C++11, §8.3.5/5
... After determining the type of each parameter, any parameter of type “array of T” or “function returning T” is adjusted to be “pointer to T” or “pointer to function returning T,” respectively...
Thus, in C++, for example, we can write the types of both f1
and f2
as void(void(*)())
.