title: terminating null char for 2D array
body: <p>I have this nested loops working but I am printing extra char at the end because I don't know how to terminate the null char in 2D array. Here is the code:</p>
  
  <pre><code>char arr[100];
  char twoDArray[100][100];
  int y = 0, x = 0,  h= 10, w = 10,j=0;
  for(y = 0; y &lt;= h; y++)
  {
    for(x = 0; x &lt;= w; x++)
    {
      twoDArray[y][x] = arr[j];
      printf("%c", twoDArray[y][x]);
      j++;
    }
  } 
  </code></pre>