How to clean ostringstream?

P

Peng Yu

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
 
V

Victor Bazarov

Peng Yu said:
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?

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
 
P

Peteris Krumins

Peng Yu said:
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?

os.str("");


P.Krumins
 
S

Stephan Br?nnimann

Peng Yu said:
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

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

Stephan Brönnimann
(e-mail address removed)
Open source rating and billing engine for communication networks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,184
Messages
2,570,973
Members
47,528
Latest member
AnaHawley8

Latest Threads

Top