I have a question about C syntax, how is it possible that this:
int a[ ][2] = { 1, 2, 3, 4 };
is legal why this is not:
int a[] = { 1, 2, 3, 4 };
int b[ ][2] = a;
or even:
int a[] = { 1, 2, 3, 4 };
int *b[2] = a;
is not legal.
What it is so hard from the pointer-math point of view that it cannot handle this by itself? Is it just a problem with the Grammar or the compilers can't infer the correct memory step-sizes?
gcc error:
main.c:14:19: error: invalid initializer
int b[ ][2] = a;