I\'m trying to figure out some C declarations. What is the meaning of these C declarations?
double (*b)[n];
double (*c[n])();
double (*d())[n];
double (*b)[n];
b is a pointer to an array of n doubles
double (*c[n])();
c is an array of n pointers to functions taking unspecified number of arguments and returning double
double (*d())[n];
d is a function taking unspecified number of arguments and returning a pointer to an array of n doubles
In general, in order to parse these kind of declarations in your head, take the following approach. Let's see the last declaration, for example
double (*d())[n];
what is the first thing that is done to d? It is called with (), therefore it's a function taking unspecified number of arguments and returnig... what's the thing done with the result? It is dereferenced (*), therefore it's a pointer to. The result is then indexed, therefore it's an array of n... what's left? a double, therefore of doubles. Reading the parts in bold, you'll get your answer.
Let's see another example
void (*(*f)(int)[n])(char)
Here, f is first dereferenced, therefore it's a pointer to... it's then called with (int), therefore a function taking int and returning , the result is then indexed with [n], so an array of n. The result is dereferenced again, so pointers to. Then the result is called by (char), so functions taking char and returning (all is left is void) void. So f is a pointer to a function taking int and returning an array of n pointers to functions taking char and returning void.
HTH