title: Compiler Error: Invalid rank specifier: expected',' or ']' on Two Dimensional Array Initialization
body: <p>I have an assignment for a class that is to be done in C#. Being a complete C# newbie, I did the project in Java first and I'm now trying to convert it to C#. I have the following function which results in the following compiler error.</p>
  
  <p>Error: <strong>Invalid rank specifier: expected',' or ']'</strong> on the following line:</p>
  
  <pre><code>int[][] grid=new int[g.cols][g.rows];
  </code></pre>
  
  <p>Visual studio is underlining the g in g.rows</p>
  
  <pre><code>public int[][] getConvergenceCounts(MandelbrotGrid g){
    int[][] grid=new int[g.cols][g.rows];
  
    for(int x=0;x&lt;g.cols;x++){
       for(int y=0;y&lt;g.rows;y++){
          double tx=x*(double)3/400-1.5;
          double ty=y*(double)3/400-1.5;
          grid[x][y]=getConvergenceCount(new Complex(ty,tx));
       }
    }
  
    return grid;
  }
  </code></pre>
  
  <p>I have no idea what I'm doing wrong here and reading up on Multidimensional arrays in C# didn't seem to help.</p>