title: Getting Spaces to Play Nicely with C++ Input Streams
body: <p>First consider this sample C++ code:</p>
  
  <pre><code>std::string input1, input2, input3;
  std::cout &lt;&lt; "Enter Input 1: ";
  std::cin &gt;&gt; input1;
  std::cout &lt;&lt; std::endl &lt;&lt; "Enter Input 2: ";
  std::cin &gt;&gt; input2;
  std::cout &lt;&lt; std::endl &lt;&lt; "Enter Input 3: ";
  std::cin &gt;&gt; input3;
  </code></pre>
  
  <p>If for input1 I enter something like "Good day neighbors" then input1 is set to "Good", input2 is set to "day" and input 3 is set to "neighbors". Im not even given the opportunity to set values for input2 and input3.</p>
  
  <p>So my question is: How can I input a string of text that include spaces into a single string without it (for lack of better terminology) breaking up and overflowing into subsequent calls to the input stream?</p>
  
  <p>Thanks in advance to any and all answers received.</p>