Connecting Tech Pros Worldwide Help | Site Map

How to clean ostringstream?

  #1  
Old July 22nd, 2005, 10:55 PM
Peng Yu
Guest
 
Posts: n/a
ostringstream os;
os << "S.par";


Suppose I have the above code. Later on, I want to clean os to be an
empty. Could you tell me what member function I should use?

Thanks,
Peng
  #2  
Old July 22nd, 2005, 10:55 PM
Victor Bazarov
Guest
 
Posts: n/a

re: How to clean ostringstream?


"Peng Yu" <pengyu.ut@gmail.com> wrote...[color=blue]
> ostringstream os;
> os << "S.par";
>
>
> Suppose I have the above code. Later on, I want to clean os to be an
> empty. Could you tell me what member function I should use?[/color]

os.str("");
os.clear();

And please use groups.google.com to search for answers that have
already been given more than once before asking them. Thanks.

V


  #3  
Old July 22nd, 2005, 10:56 PM
Peteris Krumins
Guest
 
Posts: n/a

re: How to clean ostringstream?


Peng Yu <pengyu.ut@gmail.com> wrote in message news:<j5uip05tr27u4oii7eu58tpmk4u678474u@4ax.com>. ..[color=blue]
> ostringstream os;
> os << "S.par";
>
>
> Suppose I have the above code. Later on, I want to clean os to be an
> empty. Could you tell me what member function I should use?
>[/color]

os.str("");


P.Krumins
  #4  
Old July 22nd, 2005, 10:56 PM
Stephan Br?nnimann
Guest
 
Posts: n/a

re: How to clean ostringstream?


Peng Yu <pengyu.ut@gmail.com> wrote in message news:<j5uip05tr27u4oii7eu58tpmk4u678474u@4ax.com>. ..[color=blue]
> ostringstream os;
> os << "S.par";
>
>
> Suppose I have the above code. Later on, I want to clean os to be an
> empty. Could you tell me what member function I should use?
>
> Thanks,
> Peng[/color]

We are
using os.str("");
but I don't know if it's exactly according to the standard.

Stephan Brönnimann
broeni@osb-systems.com
Open source rating and billing engine for communication networks.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
seeking within ostringstream's Adrian answers 7 September 15th, 2007 10:45 AM
ostringstream derived problem iu2 answers 15 July 4th, 2007 09:35 PM
Clean binary stream Michael answers 1 January 5th, 2007 09:25 AM
memory allocation question when using ostringstream in STL sylcheung@gmail.com answers 6 January 10th, 2006 10:25 PM