double (*bar(int, double(*)(double,double[])))(double);
While reviewing a lecture slide, I found an exercise left to the student:
In plain English, what is the type of
barin this C declaration?
Please help walk me through this. I don’t even know where to begin, except that something is ultimately returning a double.
This answer is brought to you by the ability to use the Spiral Rule. Being able to understand a complex expression by starting at the unknown element and reading around it (resolving things in the parenthesis first). A very useful skill when reading code.
That was the hard way… There are of course sites that make this easier, the cdecl site for example; but it’s good to be able to read code even when you can’t get to the internet.