title: Why isn't arr[-2] equivalent to -2[arr]?
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main() 
  {
      int arr[3] = { 10, 20, 30 };
      cout &lt;&lt; arr[-2] &lt;&lt; endl;
      cout &lt;&lt; -2[arr] &lt;&lt; endl;        
      return 0;
  }
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>4196160
  -30
  </code></pre>
  
  <p>Here <code>arr[-2]</code> is out of range and invalid, causing <strong>undefined behavior</strong>. 
  But <code>-2[arr]</code> evaluates to <code>-30</code>. Why?</p>
  
  <p>Isn't <code>arr[-2]</code> equivalent to <code>-2[arr]</code>?</p>