In accordance with the priority and associativity of the operators in the programming language C. You can understand this in the following steps:
int (*(*q)(int (*)()))(); q->*->(int (*)())->*->()->int 1 2 3 4 5
1: q - pointer
2: q is a function pointer, the function pointed to by a point has an int (*) () parameter, which is also a function pointer, indicates that the function has no parameters, and the return type is int.
3: q is the function pointer, the function pointed to by the pointer has an int (*) () parameter, which is also a function pointer, indicates that the function has no parameters, and the return type is int. And also the function q points to has a return type: pointer.
4: q is a pointer to a function, the function pointed to by the pointer has an int (*) () parameter, which is also a function pointer, indicates that the function has no parameters, and the return type is int. And also the function pointed to by q is of type return: pointer (this pointer also points to a function that has no parameter).
5: q is a pointer to a function, the function pointed to by the pointer has an int (*) () parameter, which is also a function pointer, indicates that the function has no parameters, and the return type is int. Also, the function pointed to by q is of type return: pointer (this pointer also points to a function that has no parameter, and the return type of the function is int).
source share