Re: How to flush the ostringstream buffer?
From: Jonathan Turkanis (technews_at_kangaroologic.com)
Date: 07/08/04
- Previous message: GuitarBill: "Re: How to flush the ostringstream buffer?"
- In reply to: Bill Sun: "How to flush the ostringstream buffer?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 7 Jul 2004 22:33:29 -0600
"Bill Sun" <sunshang@hotpop.com> wrote in message
news:uqXSKpJZEHA.3804@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I have a quetion about to refresh the ostringstream buffer: like
this.
>
> ostringstream buffer;
>
> buffer << 245;
> // then the buffer.str() = "245";
>
> .....
> //next I want using this buffer again but I don't need the content
of buffer
> before, so
> buffer.flush()
> buffer << 456;
> //here I hope I can get "456" from buffer.str()
>
You should use
buffer.str("");
to reset the contents of the buffer to an empty string.
Jonathan
- Previous message: GuitarBill: "Re: How to flush the ostringstream buffer?"
- In reply to: Bill Sun: "How to flush the ostringstream buffer?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|