LangProc / langproc-2018-cw

5 stars 4 forks source link

Bracket in declaration/ typedef #15

Closed liqinyang closed 5 years ago

liqinyang commented 5 years ago

Is there any test involving bracket in declaration?
It really shocked me how complicated C declaration can be.

typedef int (*myptr)[10];
myptr (*c)[10];

Here c is a pointer to an array of pointers of array of int, while

typedef int *myptr[10];
myptr *c[10];

here c is an array of pointers to an array of pointers to int

Also, do we need support typedef for pointer or array?

johnwickerson commented 5 years ago

I suggest you get the basic functionality working first and foremost. Then add support for more complicated combinations (like this one), if you have the time and inclination. I don’t want to be too prescriptive about what will or won’t be tested.