title: Populating one char array using fscanf changes the value of another char array
body: <p>I'm first using fscanf to populate my first array then again using fscanf from the same input file to populate another array.  However this seems to be shifting the values in my first array. </p>
  
  <p>Here is my input:</p>
  
  <pre><code>4 
  abcd
  efgh
  ijkl
  mnop
  qrst
  uvwx
  yz12
  3456
  </code></pre>
  
  <p>Here is my code:  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void prints( int n, char sqr[n][n]){
      for (int i = 0; i &lt; n; i++){
          for (int j = 0; j &lt; n; j++){
              printf("%c", sqr[i][j]);
          }
          printf("\n");
      }
  }
  
  int main(void){
  
      FILE *in = fopen("transform.in", "r");
      FILE *out = fopen("transform.out", "w");
  
      int num;
      fscanf(in, "%d", &amp;num);
  
      char square[num][num];
      for (int i = 0; i &lt; num; i++){
          fscanf(in, "%s", square[i]);
      }
  
      prints(num, square);
      printf("\n");
  
      char endSquare[num][num];
      for (int i = 0; i &lt; num; i++){
          fscanf(in, "%s", endSquare[i]);
      }
  
      fclose(in);
  
      prints(num, square);
      printf("\n");
  
      prints(num, endSquare);
      printf("\n");
  
      fclose(out);
  
      return 0;
  }
  </code></pre>
  
  <p>And here is the output I get:</p>
  
  <pre><code>abcd
  efgh
  ijkl
  mnop
  
  bcd
  efgh
  ijkl
  mnop
  
  qrst
  uvwx
  yz12
  3456
  </code></pre>
  
  <p>As you can see my square array seems to be changed after I populate endSquare.</p>