I already know about stringstream and how you can use it as a variable type, but I don't know how to clear it.
1 2 3 4 5
stringstream v;
int w;
string numbers;
v << w;
numbers = v.str();
I know how to do this to turn w into a string, but every time I call v << w; it adds to v. I know why it does this, but I don't know how to clear it without re-declaring it every time I use it. Do I do v << endl; or what?