title: cannot appear in a constant expression
body: <p>In the following c++ programm:</p>
  
  <pre><code>class matrix {
  public:
    int n;
    double **x;
  
    matrix(int n) : n(n) { 
      x=new double[n][n]; 
      for (int i=0;i&lt;n;i++)
      { 
         for(int j=0;j&lt;n;j++)
         {
           x[i][j]=0;
         }
      }
   }
   ...
  </code></pre>
  
  <p>I get the following error: "'n' cannot appear in a constant-expression".
  Since im relatively new to cpp i dont really know why this error occurs (especially because i did almost the exact same thing with a class called vector and there it was no problem at all) and how to fix it.
  I would really appreciate any help.</p>