I'm working on Computing Olympiads in Turkey right now. This question was asked in 2016. I scanned lots of C documentation and unfortunately I couldn't find any understandable information.
How can we write "d[-1][1][2]" in a C program? How can we put a negative integer in square brackets? Isn't this a run-time error?
int main()
{
int d[][3][2]={4,5,6,7,8,9,10,11,12,13,14,15,16};
int i=-1;
int j;
j=d[i++][++i][++i];
printf("%d",j);
return 0;
}
Output of this code?
The output is "4". How could that be? Also if you know some good documentations about multi-dimensional arrays in C, please share with me. Thanks in advance.