I have the curiosity to know the behaviour, in C, of a multidimensional array increased as below:
int x[10][10];
y = x[++i, ++j];
I know that is the wrong way. I just want to know what the compiler do in this case and what will be the consequence if a programmer do this in his code.
That is the comma operator, misused.
++i, ++jyields the value ofj + 1and has 2 side effects (modifyingiandj). The whole thing basically means++i; y = x[++j]. Which will work or not, depending on the type ofy.Well, most likely other programmers will give him/her murderous looks.