title: while ((c = getchar()) != EOF) not terminating even though code near identical to book
body: <p>Exercise 1-8 in C by Kernighan and Ritchie</p>
  <pre><code>void countBlanksTabsNewlines() {
      int c, newLines, tabs, blanks;
      newLines = 0;
      tabs = 0;
      blanks = 0;
  
      while ((c = getchar()) != EOF){
          if (c == '\n'){
              ++newLines;
          } else if(c == '\t'){
              ++tabs;
          } else if(c == ' '){
              ++blanks;
          }
      }
      printf(&quot;New Lines = %d , Tabs = %d , Blanks == %d&quot;, newLines, tabs, blanks);
  }
  </code></pre>
  <p>When I use any input then press enter, the while loop doesn't terminate.
  My code is based off the example counting just new lines from the book, so not sure how to solve.
  Thanks :)</p>
  <p>Edit: <strong>I failed to mention I am using CLion IDE and after trying the shortcuts suggested here in CLion (unsuccessfully), I tried doing the same in an online compiler and ctrl+D worked.</strong></p>