title: Reversing a two dimensional character array in C
body: <p>i am trying to write a program which reverses a entire string and also may print reversing each word of the string more than one time. 
  For example my string is: 
  "2
  Fox jumps over the lazy dog."
  for this, the output should be:
  .god .god yzal yzal eht eht revo revo spmuj spmuj xoF xoF.
  I am trying to store each word in a 2d array and then reverse each word but i am not able to do that.
  here is my code. kindly help
  <strong>Note:</strong>  how do we provide EOF in console</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
      char string[100][100];
      char ch;
      int i = 0, j = 0, l = 0, count = 0, x = 0, y = 0;
      while ((ch = getchar()) != EOF) {
          string[i][l++] = ch;
          if (ch == ' ') {
              string[i][l] = '\n';
              i++;
              l = 0;
              count++;
          }
      }
      for (x = 0; x &lt;= count; x++) {
          int length = strlen(string[x]) - 1;
          for (y = length; y &gt;= 0; --y)
              printf("%s", string[y]);
      }
      return 0;
  }
  </code></pre>