I have found a peculiar behaviour in C. Consider the below code:
struct s {
int a;
};
struct z {
int a;
struct s b[];
};
int main(void) {
return 0;
}
It compiles just fine. Then change the order of the members of struct z
like so
struct z {
struct s b[];
int a;
};
And all of a sudden we get the compilation error field has incomplete type 'struct s []'
.
Why is that?