This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: ostrstream problem
- From: "Ernest L. Williams Jr." <ernesto at ornl dot gov>
- To: John Love-Jensen <eljay at adobe dot com>
- Cc: MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Wed, 28 Sep 2005 18:38:43 -0400
- Subject: Re: ostrstream problem
- References: <BF5FF4C1.243A%eljay@adobe.com>
- Reply-to: ernesto at ornl dot gov
On Wed, 2005-09-28 at 07:20 -0500, John Love-Jensen wrote:
> Hi Ernest,
>
> I second what Peter said.
>
> Plus....
>
> You should be aware in switching from ostrstream to std::ostringstream...
>
> std::ostringstream does the memory management for you. You don't need to
> trouble yourself with ostrstream's memory management burden. That alone is
> worth switching instead of trying to use the obsolete ostrstream!
>
> std::ostringstream's backing store is a std::string, so you don't need the
> ends terminator.
Awesome. I will definitely be using std::ostringstream in the future.
Thanks,
Ernest
>
> Sincerely,
> --Eljay
>