I am using one ostringstream several times in my program. I would like to clear it after every use..., but how?
Printable View
I am using one ostringstream several times in my program. I would like to clear it after every use..., but how?
stream.str("");
stream.str.clear();
Aside from being a function, basic_ostringstream::str() returns basic_string, not basic_string &, so this won't work.Quote:
Originally Posted by Thantos
Thanks, stream.str("") worked
Ok my mistake.