C
Charles Prince
How do I reuse a ostrstream?
So far I have replaced all code that does this
"delete <ostrstream>.str()"
with
"<ostrstream>.freeze(0)"
to allow the <ostrstream>.dtor to perform it's house keeping.
Now I need to reuse the ostrstream in a few places and am starting to do
this instead of deleting and recreating a ostrstream
<ostrstream>.freeze(0);
<ostrstream>.seekp((strlen(<ostrstream>.str()) + 1), ios::cur);
Is this the correct way?
I have seen this in other code when browsing google but am unsure of
exactly what it is doing
<ostrstream>.seekp(0, ios::beg);
TIA.
So far I have replaced all code that does this
"delete <ostrstream>.str()"
with
"<ostrstream>.freeze(0)"
to allow the <ostrstream>.dtor to perform it's house keeping.
Now I need to reuse the ostrstream in a few places and am starting to do
this instead of deleting and recreating a ostrstream
<ostrstream>.freeze(0);
<ostrstream>.seekp((strlen(<ostrstream>.str()) + 1), ios::cur);
Is this the correct way?
I have seen this in other code when browsing google but am unsure of
exactly what it is doing
<ostrstream>.seekp(0, ios::beg);
TIA.