I've come across two pointer declarations that I'm having trouble understanding. My understanding of precedence rules goes something like this:
Operator Precedence Associativity
(), [ ] 1 Left to Right
*, identifier 2 Right to Left
Data type 3
But even given this, I can't seem to figure out how to evaluate the following examples correctly:
First example
float * (* (*ptr)(int))(double **,char c)
My evaluation:
*(ptr)
(int)
*(*ptr)(int)
*(*(*ptr)(int))
Then,
double **
char c
Second example
unsigned **( * (*ptr) [5] ) (char const *,int *)
*(ptr)
[5]
*(*ptr)[5]
*(*(*ptr)[5])
**(*(*ptr)[5])
How should I read them?