title: Is there a way to initialize an array with non-constant variables? (C++)
body: <p>I am trying to create a class as such:</p>
  
  <pre><code>class CLASS
  {
  public:
      //stuff
  private:
      int x, y;
      char array[x][y];
  };
  </code></pre>
  
  <p>Of course, it doesn't work until I change <code>int x, y;</code> to</p>
  
  <pre><code>const static int x = 10, y = 10;
  </code></pre>
  
  <p>Which is impractical, because I am trying to read the values of x and y from a file.  So is there any way to initialize an array with non-contant values, or declare an array and declare its size on different statements? And I know this would probably require the creation of an array class, but I'm not sure where to start on this, and I don't want to create a 2D dynamic list when the array itself is not dynamic, just the size is not known at compile-time.</p>