When C++ Gets Weird: i[a] and the Power of Pointer Arithmetic
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 ...
when-arrays-get-weird-in-c.hashnode.dev3 min read