title: while(scanf) is infinite looping?
body: <p>The code is supposed to accept a line of user input containing different characters and then print out one line containing only the letters. For example, Cat8h08er64832&amp;*^ine would be Catherine. However, the code works and outputs "Catherine" however the program doesn't exit... <a href="http://i.stack.imgur.com/TZMWh.png" rel="nofollow">see picture here</a> I'm not sure if the loop is just looping infinitely or...</p>
  
  <pre><code>int main(void){
  
    int i=0, j=0;
    char userString[1000];
    char alphabet[1000];
  
    printf("Please enter a string: ");
  
    while(scanf("%c", &amp;userString[i])){
      if((userString[i]&gt;='A' &amp;&amp; userString[i]&lt;='Z')||(userString[i]&gt;='a'&amp;&amp;userString[i]&lt;='z')){
          alphabet[j]=userString[i];
          printf("%c", alphabet[j]);
          j++;
       }
       i++;
     }
     printf("\n");
     return 0;
  }
  </code></pre>