Advanced statement:
(1) int *f , G;
This only declares an F pointer. * are all immediately followed.
(2) int *f ();
F is a function whose return value is a pointer to an integral type.
(3) Int (*f) ();
F is a function pointer, and the return value of this function is an int type.
(4) int * (*F) ();
F is a function pointer, and the return value of this function is a int* type
(5) int f[];
F is an integer array, the length of the array is temporarily omitted
(6) int *f[]
F is an array whose elements are pointers to integral types
(7) int f () []--- this declaration is illegal
Here f is a function whose return value is an integer array, but this declaration is illegal
, since the function cannot return an array, only the scalar is returned.
(8) int f[] ()--- this statement is illegal.
Here f is an array in which the return value is a function of int, this declaration is illegal
Because each function does not have the same size, the elements of the array need the same size.
(9) Int (*f[]) ();
Here f is an array, and the elements of the array are pointers to functions, and the return values of these functions are
int type
(Ten) int * (*f[]) ();
Here f is an array, and the elements of the array are function pointers, and the return values of these functions are int* type
The front is old style.
Here's the new style.
Int (*f) (int,float);
Here, F is declared as a function pointer whose arguments are int and float, the return value is int type
int * (*g[]) (int,float);
Here the G is declared as an array, the elements of the array are function pointers, and the parameters of the function are int and float
The return value is a pointer to int*.
High-level statement (--C Primer, chapter 13th)