M
Marc Schellens
is there an easy way to clear a stringstreams contents.
My problem is that I want output to be limited to 80 characters
a line. So I use operator<< to a stringstream object 'oss' and
if tellp() is > 80, I use operator<< to output
oss.rdbuf()->str();
Afterwards I want to clear oss contents. Is there a way.
pubseekpos(0) seems not to delete the former contents.
Is there maybe a more elegant way to archieve what I want?
I find 'oss.rdbuf()->str()' already to complicated.
cout << oss; oss.clear();
would look much nicer.
thanks,
marc
My problem is that I want output to be limited to 80 characters
a line. So I use operator<< to a stringstream object 'oss' and
if tellp() is > 80, I use operator<< to output
oss.rdbuf()->str();
Afterwards I want to clear oss contents. Is there a way.
pubseekpos(0) seems not to delete the former contents.
Is there maybe a more elegant way to archieve what I want?
I find 'oss.rdbuf()->str()' already to complicated.
cout << oss; oss.clear();
would look much nicer.
thanks,
marc