title: error C2131: expression did not evaluate to a constant
body: <p>When i run the program in codeblocks it works fine. but when i submitted it in codeforces it shows the error. why? i saw some solutions for one dimensional arrays. but what about multidimensional arrays?  how to take variable length for multidimensional arrays?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt;
  #include &lt;cstdio&gt;
  using namespace std;
  int main()
  {
    int h,w;
    cin&gt;&gt;h&gt;&gt;w;
    int hi[h],wi[w],arr[h][w];
    memset(arr,0,sizeof(arr));
    long long int result=1;
    for(int i=0;i&lt;h;i++)cin&gt;&gt;hi[i];
    for(int i=0;i&lt;w;i++)cin&gt;&gt;wi[i];
    for(int i=0;i&lt;h;i++){
      for(int j=0;j&lt;=hi[i];j++){
        if(j!=w)arr[i][j]=1;
      }
    }
    for(int i=0;i&lt;w;i++){
      for(int j=0;j&lt;=wi[i];j++){
        if(j!=h)arr[j][i]=1;
      }
    }
    for(int i=0;i&lt;h;i++){
      for(int j=0;j&lt;w;j++){
        //cout&lt;&lt; arr[i][j]&lt;&lt;" ";
        if(arr[i][j]==0){
            result*=2;
        }
      }
      //cout&lt;&lt;endl;
    }
    if(result==1)result=0;
    printf("%lld\n",result%1000000007);
    return 0;
  }
  </code></pre>