Alex Rivera | Logout

How do you clear a stringstream variable?

Asked 2008-08-21T18:35:57.997
613

I've tried several things already,

std::stringstream m;
m.empty();
m.clear();

both of which don't work.

Edit
Report

1 Answer

47

This should be the most reliable way regardless of the compiler:

m=std::stringstream();
answered 2012-10-11T16:00:12.300

Your Answer