title: exiting out of a loop using getline when you encounter a newline character
body: <p>this might be the most basic of questions, but I have a problem exiting out of a loop using getline. Let's say a user enters these words using std::cin in the console:</p>
  <pre><code>/*
  word
  word_one
  word_two
  
  word_three
  word_four
  */
  </code></pre>
  <p>And let' say we have defined an empty vector of vector of strings <code>vector&lt; vector&lt;string&gt; &gt;</code>. The desired <code>vector&lt; vector&lt;string&gt; &gt;</code> for this specific input must be: <code>&lt; &lt;word, word_one, word_two&gt;, &lt;word_three, word_four&gt; &gt;</code>.
  My code for the following was:</p>
  <pre><code>int main(){
      vector&lt; vector&lt;string&gt; &gt; vv;
      vector&lt;string&gt; v;
      string line;
      while(getline(cin, line)){
          if(line == &quot;\n&quot;){
              vv.push_back(v);
              break;
          }
          else{v.push_back(line);}
      }
      return 0;
  }
  </code></pre>
  <p>Any help? It feels like the if statement doesn't detect the &quot;\n&quot;. It just goes on and on endlessly. (Also, don't worry about the includes and the namespaces)</p>