title: Read empty lines C++
body: <p>I am having trouble reading and differentiating empty lines from an input. </p>
  
  <p>Here's the sample input:</p>
  
  <pre><code> number
  
   string
   string
   string
   ...
  
   number
  
   string
   string
   ...
  </code></pre>
  
  <p>Each number represents the start of an input and the blank line after the sequence of strings represents the end of an input. The string can be a phrase, not only one word.</p>
  
  <p>My code does the following:</p>
  
  <pre><code>  int n;
  
    while(cin &gt;&gt; n) { //number
  
      string s, blank;
      getline(cin, blank); //reads the blank line
  
      while (getline(cin, s) &amp;&amp; s.length() &gt; 0) { //I've tried !s.empty()
          //do stuff
      }
    }
  </code></pre>
  
  <p>I've tried directly cin >> blank, but it didn't work. </p>
  
  <p>Can someone help me solve this issue?</p>
  
  <p>Thanks!</p>