I came across the below problem in a book and on my system result is always "True" . As per my understanding, the reason for this is "int c" is optimized by compiler, hence the if() statement has no effect but i was under the impression that this would generate a error message for using c[a][b] as 'c' is not an array.
1 #include<stdio.h>
2
3 int main()
4 {
5 int a[2] = {0,0};
6 int b[1] = {0};
7 int c;
8 getchar();
9 if(a[b[c]] == c[b][a])
10 printf("True");
11 else
12 printf("False");
13 }
Can anyone please help me clear my understanding?