title: C++, cin until no more input on line using a while loop
body: <p>I am having an issue with my C++ program. I reformat and display words that a user enters into the console. If a user enters : Hi I am bob.The user will press enter after entering bob into the console. I will reformat this and reprint it in it's new format. The problem is I do not want to display a message for more input until all of the words on that console line is input. The current loop I have either displays the request for input after each word, or does not display it at all. It depends on whether or not I include the prompt or not. I need to make a while loop process each word and output it and stop after the last word. What is a Boolean param for that? I am including my code for reference.</p>
  
  <pre><code>int _tmain(int argc, _TCHAR* argv[])
  {
  
      int b;
      string input;
      string output ;
      int check = 1;
  
      while (check){
          cout &lt;&lt; "Enter in one or more words to be output in ROT13: " &lt;&lt; endl;
          cin &gt;&gt; input;
          while(my issue is here){
  
              const char *word = input.c_str();
  
              for (int i = 0; i &lt; input.length(); i++){
  
                  b = (int)word[i];
                  if (b &gt; 96){
                      if (b &gt;= 110){
                          b = b - 13;
                      }
                      else {
                          b = b + 13;
                      }
  
                      output += ((char)b);
                  }
  
                  else
                  {
                      if (b &gt;= 78){
                          b = b - 13;
                      }
                      else {
                          b = b + 13;
                      }
  
                      output += ((char)b);
                  }
  
  
  
  
  
  
  
              } 
              cout &lt;&lt; output &lt;&lt; endl;
              output = "";
              cin &gt;&gt; input;
  
          }
  
              check = 0;
  
      }
  
      return 0;
  }
  </code></pre>