following code
a[10] == 10[a]
the result seems true
in C-language
how C compiler sees both of them as the same ?
following code
a[10] == 10[a]
the result seems true
in C-language
how C compiler sees both of them as the same ?
a[10] means: "Start at memory address 10, add a to it and reference the resulting location" 10[a] means: "Start at memory address a, add 10 to it and reference the resulting location"
Since a + 10 is the same as 10 + a, both expressions will refer to the same memory location.