bormuth
asked on
reset a stringstream
Is it possible to reset a stringstream so that it is empty afterwards.
stringstream s;
s << "Hello";
s.reset(); // <-- HOW TO DO THIS
std::cout s.str(); // <-- Should print NOTHING
(Even s = stringstream() doesn't work).
ASKER
Axter:
There is no asignment operator for stringstream...
Error E2285: Could not find a match for 'stringstream::operator =(stringstream)'
What compiler are you using?
ASKER
Borland C++ 5.5.1 for Win32
>>There is no asignment operator for stringstream...
There is an assignment operator in VC++.
There is an assignment operator in VC++.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yea ... that's great !!!
Thanks ....
Example:
int main()
{
stringstream s;
s << "Hello";
s = stringstream("");
std::cout << s.str(); // <-- Should print NOTHING
return 0;
}