Possible Duplicate:
In C arrays why is this true? a[5] == 5[a]
array[index] 和 index[array] 可能是编译器特性还是语言特性。第二个怎么可能?
最佳答案
编译器会转
index[array]
进入
*(index + array)
使用正常的语法会变成这样
array[index]
进入
*(array + index)
因此您会看到两个表达式的计算结果相同。这适用于 C 和 C++。
关于C++ 数组 [索引] 与索引 [数组],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/905724/