title: concatenate stringstream in c++
body: <p>How can I concatenate two stringstreams?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;sstream&gt;
  #include &lt;string&gt;
  #include "types.h"    
  
  int main () {
      char dest[1020] = "you";
      char source[7] = "baby";
      stringstream a,b;
      a &lt;&lt; source;
      b &lt;&lt; dest;
      a &lt;&lt; b; /*HERE NEED CONCATENATE*/
      cout &lt;&lt; a &lt;&lt; endl;
      cout &lt;&lt; a.str() &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  
  <p>The output is the following in both tries:</p>
  
  <pre><code>0xbf8cfd20
  baby0xbf8cfddc
  </code></pre>
  
  <p>The desired output is <code>babyyou</code>.</p>