title: 2D array get filled with garbage when passed as a pointer to function
body: <p>I have this array declared inside my main() function:</p>
  
  <pre><code>int   VISITED[9][9]={{0,0,0,0,0,0,0,0,0},
      {0,0,0,0,0,0,0,0,0},
      {0,0,0,0,0,0,0,0,0},
      {0,0,0,0,0,0,0,0,0},
      {0,0,0,0,0,0,0,0,0},
      {0,0,0,0,0,0,0,0,0},
      {0,0,0,0,0,0,0,0,0},
      {0,0,0,0,0,0,0,0,0},
      {0,0,0,0,0,0,0,0,0}};
  </code></pre>
  
  <p>it is getting passed to a function called qneighbor with the line</p>
  
  <pre><code>qneighbor (5,5,1, 0, &amp;pawn_positions, &amp;PAWNS, WALLH, WALLV, &amp;VISITED);
  </code></pre>
  
  <p>qneighbor signature looks like this:</p>
  
  <pre><code>CELL* qneighbor( int root_row, int root_col, int p, int dist, struct GameTable* PAWN_POSITIONS, int (*PAWNS)[9][9], int WALLH[8][9], int WALLV[9][8], int (*VISITED)[9][9]){...}
  </code></pre>
  
  <p>However, when debugging, I see that after the fifth line, it is getting filled with garbage , immediately after being passed to qneighbor (before any command is executed). What could be going wrong?</p>