Re: ostringstream objects


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

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.



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]