A
Andy
1) Are the manipulators like std::endl and std::ends independent of
character set. That is, can I use the same manipulators in both the
following cases:
a)
<code>
std::basic_stringstream<char> strm;
strm<<"What goes up ... !"<<std::endl<<"You know the
rest!"<<std::ends;
</code>
b)
<code>
std::basic_stringstream<wchar_t> wstrm;
wstrm<<L"What goes up ... !"<<std::endl<<L"You know the
rest!"<<std::ends;
</code>
(Please overlook any windows specifics, see the problem below and
don't redirect me to ms.microsoft....)
2) Is it possible to clear a stringstream after writing to it and then
using it again? I mean I want this:
<code>
std::basic_stringstream<char> strm;
strm<<"What goes up ... !"<<std::endl<<"You know the
rest!"<<std::ends;
/*
... do something so that strm has no characters and we can write to
it (may
be remove std::ends if it prevents that)
*/
strm<<"Here is a new string ... with no strings attached before
it"<<std::endl;
</code>
character set. That is, can I use the same manipulators in both the
following cases:
a)
<code>
std::basic_stringstream<char> strm;
strm<<"What goes up ... !"<<std::endl<<"You know the
rest!"<<std::ends;
</code>
b)
<code>
std::basic_stringstream<wchar_t> wstrm;
wstrm<<L"What goes up ... !"<<std::endl<<L"You know the
rest!"<<std::ends;
</code>
(Please overlook any windows specifics, see the problem below and
don't redirect me to ms.microsoft....)
2) Is it possible to clear a stringstream after writing to it and then
using it again? I mean I want this:
<code>
std::basic_stringstream<char> strm;
strm<<"What goes up ... !"<<std::endl<<"You know the
rest!"<<std::ends;
/*
... do something so that strm has no characters and we can write to
it (may
be remove std::ends if it prevents that)
*/
strm<<"Here is a new string ... with no strings attached before
it"<<std::endl;
</code>