Posted by Leon Gunden on March 27, 2001 at 18:43:57:
In Reply to: ostringstream objects posted by Anthony Zucaro on March 27, 2001 at 17:53:50:
The slides are wrong (disconcerting isn't it). When you declare an ostream and pass its constructor a string, the ostream allocates its own copy of the string. The original string is not changed. I have no idea what the notes are talking about...
To do what you wish to do simply use the ostringstream as indicated in the notes, but when you want to get the final assembled string call out.str() (assuming your ostringstream is named out).
Hope this helps.
Post a Followup