title: why use EOF to check if stdin buffer is cleared
body: <p>Say I have the following...</p>
  
  <pre><code>int main () {     
     char name [5] = "";
     char c;
     printf("Enter a name: ");
     fgets(name,5,stdin);
     while ((c = getchar()) != '\n');
     printf("Exiting...);
     getchar();
     return 0;
  }
  </code></pre>
  
  <p>The while loop will clean the stdin buffer but I have seen the loop done like this as well...</p>
  
  <pre><code>while ((c = getchar()) != '\n' &amp;&amp; c != EOF);
  </code></pre>
  
  <p>I am wondering if there is any difference between the 2??? Does testing for EOF make any difference?</p>