title: Getchar() doesn't work?
body: <p>I was confused by the <strong>getchar()</strong> function, so I searched this great website and read all the relative topics and read about getchar() in K&amp;R book. But when I ran the code, typed a word on the console screen, and hit enter, nothing happened. I expected the number of characters to be displayed.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main(void)//doesn't work??
  {
  int c ;
  int count ;
  
  while ( ( c = getchar() ) != EOF )
     count ++ ;
  
  printf( "%d characters\n" , count ) ;
  return 0;
  }
  </code></pre>