This is also true in C (but not C++) since x[y] is defined as *(x+y)
regardless of the types of x and y. Note that addition of pointers is
commutative, although one operand has to be pointer and the other
integral.
On C++ this is not true in general if x is a class type, since the
former would invoke x.operator[](y), whereas the latter would be
interpreted as *(x.operator+(y)) and there ain't no law that says they
have to be the same, and generally won't be.
-hpa
-- PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD 1E DF FE 69 EE 35 BD 74 See http://www.zytor.com/~hpa/ for web page and full PGP public key I am Bahá'í -- ask me about it or see http://www.bahai.org/ "To love another person is to see the face of God." -- Les Misérables- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/