title: VS2008 error expected constant expression on declaring array, but no error for this code in GCC
body: <p>I have following function</p>
  
  <pre><code> void someFun(int* ar, const int size) {
        int newAr[size];
        //do something 
   }
  </code></pre>
  
  <p>And I get for this line three errors:</p>
  
  <pre><code>Error   1   error C2057: expected constant expression   
  Error   2   error C2466: cannot allocate an array of constant size 0    
  Error   3   error C2133: 'newAr' : unknown size 
  </code></pre>
  
  <p>But var <strong>size</strong> is constant! And using gcc this is compiled without errors. Can you tell me what and why is wrong here for vs2008(or for Visual C++ in general maybe)? Thanks in advance.</p>