Int I; // defines an int type variable I. In this case, typedef int; // indicates that you have defined an integer data type int, which is equivalent to int: int II; // defines an int type variable II; void (* PFn) (void) // defines a function pointer, this function pointer points to the function entry address similar to void Foo (void) function typedef void (* Fun) (void) // indicates that you have defined a function pointer data type fun PF; // define a function pointer PF. Change the function pointer to a function similar to void * PF (void). // Leo char * A = "this is "; // allocate a space in the constant area, and a points to the space char a [] = "this is"; // allocate a space in the constant area, then, allocate a space on the stack and copy the content of the constant area. Therefore, you can modify /* ///////// Define a function pointer type ////// // * // For example, you have three functions: void Hello (void) {printf ("Hello! ");} Void Bye (void) {printf (" goodbye! ");} Void OK (void) {printf (" OK! ");} Typdef void (* funcptr) (void); // This constructs a general function. You can use it like this: void speak (int id) {funcptr words [3] = {& hello, & bye, & OK}; funcptr fun = words [ID]; (* Fun, if speak (0) is displayed, "Hello!" Speak (1) will show "Goodbye !" Speak (2) will display "OK !" A group of functions that process parameters and return values in the same form, but have uncertain functions can use function pointers such as arithmetic operators, addition, subtraction, multiplication, and division, can be represented by typedef int (* calc) (INT, INT), etc.
Typedef void (* Fun) (void );