title: do...while() repeating the last string twice
body: <p>The following code splits the provided string/line down to the characters. Why does the loop repeats that last string twice? How to fix it?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;sstream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  int main()
  {
      string main, sub;
      cout &lt;&lt; "Enter string: ";
      getline(cin, main);
      istringstream iss(main);
      do
      {
          iss &gt;&gt; sub;
          cout &lt;&lt; sub &lt;&lt; endl;
          vector&lt;char&gt; v(sub.begin(), sub.end());
          for(int i = 0; i &lt; v.size(); i++)
           {
               cout &lt;&lt; v[i] &lt;&lt; endl;
           }
      } while (iss);
      return 0;
  }
  </code></pre>
  
  <h3>Input:</h3>
  
  <blockquote>
    <p>hello world</p>
  </blockquote>
  
  <h3>Desired output</h3>
  
  <blockquote>
    <p>hello<br>
    h<br>
    e<br>
    l<br>
    l<br>
    o<br>
    world<br>
    w<br>
    o<br>
    r<br>
    l<br>
    d  </p>
  </blockquote>
  
  <h3>Actual output:</h3>
  
  <blockquote>
    <p>hello<br>
    h<br>
    e<br>
    l<br>
    l<br>
    o<br>
    world<br>
    w<br>
    o<br>
    r<br>
    l<br>
    d<br>
    world<br>
    w<br>
    o<br>
    r<br>
    l<br>
    d  </p>
  </blockquote>
  
  <p>I have removed elements which are unrelated to the problem as much as possible</p>