title: Build string from another strings in loop using stringstream
body: <p>I want to build one string from strings that are typed in loop by <code>getline()</code></p>
  
  <pre><code>cin &gt;&gt; n;
  string all,line;
  stringstream ss;    
  
  for (int i = 0; i &lt; n; i++)
      {
          ss.clear();
          line.clear();
          cin.ignore();
          getline(cin, line, '\n');
          ss.str(line);
          all += ss.str();
  
      }
      cout &lt;&lt; all &lt;&lt; endl;;
  </code></pre>
  
  <p>I expected:</p>
  
  <pre><code>input:
  2
  word
  word
  
  output:
  wordword
  </code></pre>
  
  <p>Instead of this I get:</p>
  
  <pre><code>input:
  2
  word
  word
  
  output:
  wordord
  </code></pre>
  
  <p>I can't find solution for that. Could someone help me?</p>