title: Incrementing array elements in C
body: <p>I'm new to C and I'm currently trying to make my way through Kernighan and Ritchie's book. I have a question about the code they use to introduce arrays.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      int c, i, nwhite, nother;
      int ndigit[10];
  
      nwhite = nother = 0;
      for (i = 0; i &lt; 10; ++i) /* What does this 'for' loop do? */
  
      {
          ndigit[i] = 0; 
      }
      while ((c = getchar()) != EOF)
          if (c &gt;= '0' &amp;&amp; c &lt;= '9') /* Why are the numbers in quotes? */
          {
              ++ndigit[c - '0']; /* What does the "- '0'" part do? */
  
          }
          else if (c == ' ' || c == '\n' || c == '\t')
          {
              ++nwhite;
          }
          else
          {
              ++nother;
          }
      printf("digits =");
      for (i = 0; i &lt; 10; ++i)
          printf(" %d", ndigit[i]);
      printf(", white space = %d, other = %d\n", nwhite, nother);
  }
  </code></pre>