title: Warning: assignment from incompatible pointer type
body: <p>While compiling the below code, I am getting warning:<br/></p>
  
  <blockquote>
    <p>warning: assignment from incompatible pointer type<br/>
    maze->mazeValue = mazeValue;<br/></p>
  </blockquote>
  
  <p>This is the maze solving code. Have tried it but couldn't identify the issue. If I change <br/> <code>char  mazeValue[BUFFERSIZE][BUFFERSIZE]</code> to <code>char \*\* mazeValue**</code>, the program gets compiled the did not execute. Windows throws alert. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;unistd.h&gt;
  
  #define BUFFERSIZE (1000)
  #define MAZE_ENTRANCE '.'
  
  
  struct maze {
      char ** mazeValue;
      int startx, starty;
      int numrows;
      int initdir;
  };
  
  void ReadMaze(struct maze * maze);
  
  int main(int argc, char *argv[]) {
      struct maze maze;
  
  
      ReadMaze(&amp;maze);
      printf("Thanks");
      //PrintStage(&amp;maze);
  
      return EXIT_SUCCESS;
  }
  
  
  /*  Creates a maze from a file  */
  
  void ReadMaze(struct maze * maze) {
      char buffer[BUFFERSIZE];
      char  mazeValue[BUFFERSIZE][BUFFERSIZE];
      //char workingMaze [BUFFERSIZE][BUFFERSIZE];
      //char ** map;
      int rows = 0, foundentrance = 0, foundexit = 0;
      int columns = 0, i = 0;
  
      /*  Determine number of rows in maze  */
  
  
      while ( fgets(buffer, BUFFERSIZE, stdin) ){
  
         //puts(buffer);
         columns = strlen(buffer);
  
         /*
         for(i=0; buffer[i] != '\0'; i++)
         {
              //printf("Row: %d\n", rows);
              //putchar(buffer[i]);
              //printf("\n");
              mazeValue[rows][i] = buffer[i];
              //putchar(mazeValue[rows][i]);
              //printf("\n");
         }
         */
  
         strcpy(mazeValue[rows], buffer);
  
         for ( i = strlen(mazeValue[rows]) - 1; isspace(mazeValue[rows][i]); --i )
              mazeValue[rows][i] = 0;
  
          /*  Check for entrance and save the location if it finds  */
  
          if ( !foundentrance &amp;&amp; rows == 0) {
              i = 0;
  
              printf("rows %d\n", rows );
              printf("i %d\n", i );
  
              while ( mazeValue[rows][i] != MAZE_ENTRANCE &amp;&amp; mazeValue[rows][i++] ){
  
                  if ( mazeValue[rows][i] == MAZE_ENTRANCE ) {
                      maze-&gt;startx = i;
                      maze-&gt;starty = rows;
                      foundentrance = 1;
                  }
              }
          }
          ++rows;
      }
  
      maze-&gt;mazeValue = mazeValue;
      maze-&gt;numrows = rows;
  
      printf("maze-&gt;startx %d\n", maze-&gt;startx);
      printf("maze-&gt;starty %d\n", maze-&gt;starty );
  
      printf("\n");
      printf("Stage 1\n");
      printf("=======\n");
      printf("maze has %d rows and %d columns\n\n", rows, columns);
  
      i=0;
      int j;
  
      for(i=0; i&lt;=rows; ++i)
      {
          for(j=0; j&lt;=columns; ++j){
              printf("%c", mazeValue[i][j]);
              printf("%c", mazeValue[i][j]);
          }
          printf("\n");
      }
  
      printf("\n");
      printf("foundentrance: %d\n", foundentrance);
  
  }
  </code></pre>