5 ms·
It seems this only really matters in function prototype declarations that contain multidimensional arrays. Compare: int foo(char [][*]); int bar(char [
by xelxebar 8y ago
It seems this only really matters in function prototype declarations that contain multidimensional arrays. Compare:
int foo(char [][*]);
int bar(char [][]);
The second declaration should give an error.
I'm getting this from just reading the spec now, but it looks like the reason has to do with "incomplete" versus "complete" types.
Something like 'int arr[]' is an "incomplete type", i.e. an array of ints with unspecified size. While 'int arr[*]' is a complete type for an array with variable length. I'm guessing that array elements must have a complete type, which is why the above snippet gives an error.
- anilakar 8y agoIf I understood correctly, this will be removed in C2x.