|
|
|
C's index[arr] notation
|
|
5 points
by leegao
5542 days ago
|
|
I had always assumed that it was merely some strange artifact of the language, until I finally thought about it, and then finally understood: arr[index] is equivalent to (arr + index), which by the commutative property of addition is equivalent to (index + arr) = index[arr]. Mind = blown |
|
arr[index] == arr + (n * size_of(type)) == (n * size_of(type)) + *arr