title: why doesn't the getline() terminate when I input a newline?
body: <p>I have this code:</p>
  <pre><code>string sentence2;
  while(getline(cin, sentence2)){
      // while there are lines coming in
      cout &lt;&lt; sentence2 &lt;&lt; endl;
  }
  </code></pre>
  <p>on VSCode, I put my final input as an empty line by pressing &quot;Enter&quot; key. The code returned an empty line. Why doesn't the loop terminate instead?</p>