title: White space on the end of output string not printing with the string, but rather with the next printed line after it
body: <p>I tried to print a line that asks for input from the user, get the input, then print again some line. The problem is that the white space at the end of the first printed line is printed not at the end of the line, but rather at the beginning of second printed line, after i get the input.</p>
  
  <p>I'm completely new to C++ so I couldn't really try much, but i tried printing the code without the part that prompts the input from the user, and it prints the space just fine, but when i add <code>std::cin &lt;&lt; input;</code> the space get's sent to the beginning of the second line.  </p>
  
  <p>My code:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>    int input;
      std::cout &lt;&lt; "Enter your favorite number between 1 and 100: ";
      std::cin &gt;&gt; input;
      std::cout &lt;&lt; "Amazing... That's my favorite number too... wow..." &lt;&lt; std::endl;
  </code></pre>
  
  <p>I want the output to be</p>
  
  <pre class="lang-none prettyprint-override"><code>Enter your favorite number between 1 and 100: //some input
  Amazing... That's my favorite number too... wow...
  </code></pre>
  
  <p>(note the space before <code>//some input</code>)</p>
  
  <p>Instead i get</p>
  
  <pre class="lang-none prettyprint-override"><code>Enter your favorite number between 1 and 100://some input
   Amazing... That's my favorite number too... wow...
  </code></pre>
  
  <p>(note the space before <code>Amazing</code>)</p>
  
  <p>Edit: I'm using Clion if it could be connected. Also, I tried to run the executable on powershell and it worked as expected, without the problem, so this has something to do with the Clion terminal. Also, i'm using windows 10 as my OS.</p>
  
  <p>Second Edit: add my findings on my answer.</p>