title: "expression must have a constant value" visual studio error E0028
body: <pre><code>#define max 40
  ...
  
  void transpose(int matrix[][max], int* row, int* col)
  {
      int data[*row][max]; //expression must have a constant value at *row.
      for (int i = 0; i &lt; *row; i++)
      {
          for (int j = 0; j &lt; *col; j++)
          {
              data[i][j] = matrix[i][j];
          }
      }
      int _col = *row; //this *row works fine.
      *row = *col; //also this *row works fine.
      *col = _col;
      for (int i = 0; i &lt; *row; i++) //this *row is fine too.
      {
          for (int j = 0; j &lt; *col; j++)
          {
              matrix[i][j] = data[j][i];
          }
      }
  }
  
  int main()
  {
      ...
      if (...)
      {
          int row = 0, col = 0;
          int matrix[30][max];
          if (FunctionReadFile(Parameters[0], matrix, &amp;row, &amp;col))
          {
              ...
              transpose(matrix, &amp;row, &amp;col);
              ...
          }
          ...
      }
      ...
      return 0;
  }
  </code></pre>
  
  <p>I tried put 'const' before int but it still show this error at [*row], why does this error occured and how to fix it? Does declaring an dynamic array is the only to fix this problem, any possible solution easier?</p>