When C++ Gets Weird: i[a] and the Power of Pointer Arithmetic
May 19, 2025 · 3 min read · When you first learn arrays in C++, you’re taught that a[i] accesses the i-th element of the array. Simple enough, right? But what if I told you that writing i[a]—yes, flipping the index and the array—also works? This might seem like a typo, or even ...
Join discussion