title: Difference between `a` and `&a` in C++ where `a` is an array
body: <p>I am confused about the output of the following code. </p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;cstdlib&gt;
  using namespace std;
  int main()
  {
    int a[] = {1,2,3};
    cout &lt;&lt; a         &lt;&lt; "  " &lt;&lt; &amp;a         &lt;&lt; endl;
    cout &lt;&lt; sizeof(a) &lt;&lt; "  " &lt;&lt; sizeof(&amp;a) &lt;&lt; endl;
    return 0;
  }
  </code></pre>
  
  <p>The output is </p>
  
  <pre><code>0xbfcd3ae4  0xbfcd3ae4
  12  4
  </code></pre>
  
  <p>How can <code>a</code> and <code>&amp;a</code> print the same expression  but have different sizes? 
  I always thought that for any array, its name always has the value = address of the first byte. </p>
  
  <p>Also <code>&amp;a</code> should not make sense, since one cannot have an address (obtained with the &amp; operator) to an address(the value of a). Yet the code gives an output and infact 'a == &amp;a'
  according to the output. </p>
  
  <p>Similarly why is the output of <code>sizeof(a) = 12</code> (which is the total memory occupied) 
  by the array? <code>a</code> being a "pointer" itself sizeof(a) = 4 bytes (on my 32 bit Ubuntu 11.04)</p>
  
  <p>Obviously there is some misconception I am having. Could some one sort this out for me ?  </p>