title: How to get the last charactor you put in an ostream object out
body: <p>I'm doing a programming work, it's like this</p>
  
  <pre><code>vector&lt;Member&gt; members;
  stringstream ss;
  stringstream ss1;
  for (vector&lt;Member&gt;::iterator it = members.begin; it != members.end(); it++){
       ss &lt;&lt; it-&gt;name &lt;&lt; ",";
       if (check(it-&gt;id)){
           ss1 &lt;&lt; it-&gt;name &lt;&lt; ",";
       }
  }
  </code></pre>
  
  <p>so, at last ,there will be a "," that I don't need, I want to get that out of ss, how to do this, I know I can use some varible to control this in for, but I think Directly manipulating ss will be more convenient
  the method provide by some friend here can not handle the situation of ss1,  how can I control the "," of ss1.<br>
  and Can someone tell me why ostream can not give back any data but istream can putback data</p>