title: How to print a 2d array with a function in C?
body: <p>I'm trying to print a 2d array with a function, but I keep getting the error <code>"pointer expected"</code>  </p>
  
  <p>I'm trying to make a battleship-type grid. I'm fine with printing out the co-ordinate row and column, but I can't actually get the 2d array (which contains "." in every element) to print at all.</p>
  
  <p>Any help would be appreciated, I'm very new to this. Thanks! :)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  int length;
  int width;
  int i;
  int j;
  char invisible_board;
  
  
  void board_setup(int *rows, int *columns){
      char *invisible_board[*rows][*columns];
  char *player_board[*rows][*columns];
  
  for (i = 0; i &lt; *rows; i++){
      for (j = 0; j &lt; *columns; j++){
          invisible_board[i][j] = ".";    //Sets all elements in hidden board to water
      }       
  }
  
  for (i = 0; i &lt; *rows; i++){
      for (j = 0; j &lt; *columns; j++){
          player_board[i][j] = ".";
      }
  }
  }
  
  void display(int *rows, int *columns, char *invisible_board){
  
  printf("   ");
  for (i=1; i &lt; *rows +1;i++){
      printf("%d  ",i);
  }
  printf("\n");                       //Prints top row of co-ordinates
  
  for (i=1; i &lt; *columns+1;i++){
      printf("%d ",i);
      for (j=0;j &lt; *columns;j++){         //Prints left column of co-    ordinates and rows of game board
              printf(" %c ",invisible_board[i-1][j]);
          }
          printf("\n");
          }
  
  }
  
  int main(void){
  
      printf("Please enter the amount of rows in your board\n");
      scanf("%d",&amp;length);
      printf("Please enter the amount of columns in your board\n");
      scanf("%d",&amp;width);
  
      board_setup(&amp;length,&amp;width);
      display(&amp;length,&amp;width,&amp;invisible_board);
  
      return (0);
  }
  </code></pre>