First go to the instance for analysis
# Include <stdio. h>
Void myfun (void );
Int main (void)
{
Void (* PF) (void );
PF = myfun;/* can also be assigned as follows: pF = & myfun; the same principle */
(* PF )();
PF ();
Return 0;
}
Void myfun (void)
{
Printf ("Hello world! \ N ");
}
Method 1: because pf points to the myfun function, * PF is the myfun function, so the expression (* PF) () is the same as myfun.
From the declaration of myfun and PF, we can see that myfun and (* PF) are equivalent.
Method 2: because the function name is a pointer, pointers and function names can be used interchangeably. Therefore, PF () is the same as myfun.
From the PF assignment statement, we can see that PF and myfun are equivalent.
This is the historical reason for C's development process. It represents the different views of the two groups!
However, the most critical point is that the C standard accepts both of them as equivalent form !!!
Function pointer call Method