title: expression must have a constant value error in c++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/972705/is-there-a-way-to-initialize-an-array-with-non-constant-variables-c">Is there a way to initialize an array with non-constant variables? (C++)</a>  </p>
  </blockquote>
  
  
  
  <p>I have the following code: </p>
  
  <pre><code>vector&lt;vector&lt;vec2&gt;&gt; vinciP;
      int myLines = -1;
      myLines = drawPolyLineFile("vinci.dat", vinciP);
      if (myLines &gt; -1)
      {
          cout &lt;&lt; "\n\nSUCCESS";
          vec2 vPoints[myLines];
          for (int i = 0; i &lt; NumPoints; ++i)
          {
              vPoints[i] = vinciP[0][i];
          }
      }
  </code></pre>
  
  <p>I'm getting an error on the line 'vec2 vPoints[myLines];' that says expressions must have a constant value. I don't understand why I'm getting this error, any help?</p>
  
  <p>Is it because myLines could be negative? idk.</p>