title: C++ Variable expressions for defining array size?
body: <p>I'm a newb at C++ and I practice coding on my school computer, so I have to use an online compiler (www.CompileOnline.com).  I have a variable that is defined by a function and is then used to initialize an array like so:</p>
  
  <p>int var = function(a);</p>
  
  <p>int num[var];</p>
  
  <p>This code works just fine on the website, but on Visual Studio Express 2012 it gives me an error:</p>
  
  <p>C2057: expected constant expression</p>
  
  <p>Is this a problem with Visual Studio? I've read that it's a C++ rule, but then why does it work on the website? Any help is appreciated, thanks.</p>