title: Why C/C++ accepts reversed array access?
body: <p>Yesterday, I found this funny little piece of code:</p>
  <pre><code>#include &lt;iostream&gt;
  
  int main()
  {
     int a[2] = {1, 2};
     std::cout &lt;&lt; 1[a];
     return 0;
  }
  </code></pre>
  <p>And it runs, printing out the 2 to the console. I don't get why. My only idea that since <code>a[1]</code> is equal to <code>*(a + 1)</code>, in theory we could swap the operations, so we would get <code>*(1+a)=1[a]</code>. But accepting the <code>[]</code> operator for a number still looks strange. Does anyone have an official answer to this question?</p>