title: error : no match for 'operator[]'
body: <p>I am solving a problem in which I m trying to pass address a 2-D array of a structure and trying to manipulate it but, whenever I use <code>[]</code> operator to access the array elements , I get a compile time error:</p>
  
  <blockquote>
    <p>no match for 'operator[]'</p>
  </blockquote>
  
  <p>in my codeblocks IDE.</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  typedef struct mat
  {
     int data;
     int flag;
  } cell;
  
  int mat(cell *);
  
  int main()
  {
      int m,n;
      cin&gt;&gt;m&gt;&gt;n;
      cell game[n][m];
      cout&lt;&lt;"The length of matrix is "&lt;&lt;mat(&amp;game[0][0]);
  }
  
  int mat(cell *arr)
  {
      return (sizeof(arr[0])/sizeof(arr[0][0]));
  }
  </code></pre>