title: Why is arr and &arr the same?
body: <p>I have been programming c/c++ for many years, but todays accidental discovery made me somewhat curious... Why does both outputs produce the same result in the code below? (<code>arr</code> is of course the address of <code>arr[0]</code>, i.e. a pointer to <code>arr[0]</code>. I would have expected <code>&amp;arr</code> to be the adress of that pointer, but it has the same value as <code>arr</code>) </p>
  
  <pre><code>  int arr[3];
    cout &lt;&lt; arr &lt;&lt; endl;
    cout &lt;&lt; &amp;arr &lt;&lt; endl;
  </code></pre>
  
  <p>Remark: This question was closed, but now it is opened again. (Thanks ?)</p>
  
  <p>I know that <code>&amp;arr[0]</code> and <code>arr</code> evaluates to the same number, but that is <em>not</em> my question! The question is why <code>&amp;arr</code> and <code>arr</code> evaluates to the same number. If <code>arr</code> is a literal (not stored anyware), then the compiler should complain and say that <code>arr</code> is not an lvalue. If the address of the <code>arr</code> is stored somewhere then <code>&amp;arr</code> should give me the address of that location. (but this is not the case)</p>
  
  <p>if I write</p>
  
  <blockquote>
    <p>const int* arr2 = arr;</p>
  </blockquote>
  
  <p>then <code>arr2[i]==arr[i]</code> for any integer <code>i</code>, but <code>&amp;arr2 != arr</code>. </p>