title: While loop with EOF that always prompts for input
body: <p>I've been spending some time with this issue and decided to come here to see if anyone would be able to help me.
  I have a given text file I made and I am sending the contents of the text file to my program when it is being run.
  For example:
   if I say </p>
  
  <pre><code>    scanf("%d", &amp;integerOne); 
  </code></pre>
  
  <p>then my text file should place the first line (for example) the number 8 into that slot
  I want this to keep doing this until it reaches the end of the file, but that is where I am running into trouble.</p>
  
  <p>Unlike my example above I am using chars:</p>
  
  <pre><code>    while((scanf("%s", userstring)) != EOF)
      {
              if(userstring[0] == 'c')
              {
                    scanf("%d", &amp;cinput); 
              }
             if(userstring[0] == 'a')                       
             {        
                      scanf("%d", &amp;cone);
                      scanf("%d", &amp;cone);
             }
      }
  </code></pre>
  
  <p>Just for some background, I made the array 'userstring' to hold either 'c' (for connect) or 'a' (for add). I was trying to get the program to execute to loops and other functions when it did not receive any more 'char' input.
  All of your insight is extremely helpful. Much thanks, Alex.</p>