The priority rules for the C language declaration mentioned in Expert C programming ("C Expert programming") are as follows:
A declaration begins reading from its name and then reads sequentially in order of precedence;
B priority from high to low is:
The part of the B.1 declaration that is enclosed in parentheses;
B.2 suffix operator: bracket () means that this is a function, and square brackets [] indicate that this is an array;
B.3 prefix operator: asterisk * logo "points to ... The pointer ";
C if the const and/or volatile keyword is followed by a type specifier (such as a int,long, etc.), it acts on the type descriptor, and in other cases the const and/or volatile keywords are used for the pointer asterisk immediately to the left of it.
and give examples: char * const * (*next) ();
A next--next for the name of the declaration
B.1 (*next)--next as a pointing ... The pointer
B.2 (*next) ()--next is a function pointer
B.3 * (*next) ()--next is a function pointer that returns a point to ... The pointer
C char * const--A constant pointer to a character type
So char * const * (*next) means: Next is a function pointer that returns a constant pointer to the character type
Here we will analyze a statement ourselves:
Int (*foo ()) [];
Deduce it for yourself, and then look at the result: Foo is a function that returns a pointer to an integer array. Isn't that right? Here we look at the specific derivation process:
A foo--foo for the name of the declaration
B.2 foo ()--foo is a function
B.3 (*foo ())--foo is a function that returns a pointer to ... The pointer
B.2 (*foo ()) []--foo is a function that returns a pointer to an array
C Int (*foo ()) []--foo is a function that returns a pointer to an integer array