title: Arrays with a size determined at run time, is this valid in C++?
body: <p>So I was talking to my friend, helping her with a piece of code, and I always thought that arrays needed to be compile-time constants, as they are on the stack. But she said that her friend did this using this code:</p>
  
  <pre><code>#include &lt;iostream.h&gt;
  #include &lt;stdlib.h&gt;
  int main()
  {
      int value = ' ' ;
      int sum = 0;
      int count = 0;
      cout&lt;&lt;"Please enter the total number of employees" &lt;&lt;endl;;
      cin&gt;&gt; value;
      int numbers[value];
      cout&lt;&lt;"Now enter the employees corresponding salaries" &lt;&lt;endl;;
      for (int k = 0; k &lt; value; k++)
      {
          cin &gt;&gt; numbers[k];
      }
  }
  </code></pre>
  
  <p>They are using Dev-C++.</p>
  
  <p>Is this code suppose to work? I assume not.</p>