title: Where does c++ store the size of fix sized array?
body: <p>This problem is a follow up from <a href="https://stackoverflow.com/questions/6159968/declaring-array-of-int">Declaring array of int</a></p>
  
  <p>Consider the following program:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  int main()
  {
    int x[10];
    std::cout &lt;&lt; sizeof(x) &lt;&lt; std::endl;
    int * y = new int [10];
    std::cout &lt;&lt; sizeof(y) &lt;&lt; std::endl;
    //delete [] y;
  }
  </code></pre>
  
  <p><code>sizeof(x)</code> prints 40 (total size), <code>sizeof(y)</code> prints 8 (pointer size)</p>
  
  <p>It looks interesting, to me <code>int x[10]</code> is no different than <code>y</code> except it is located in the stack. Where does c++ actually stored the size of <code>x</code>? Does c++ get it from the stack? Or a fix sized array is treated as a struct with size internally? </p>