Possible Duplicate:
In C++, how do you clear a stringstream variable?
I have a problem with a string i want to use to display in my loop.
I set it up like this in my loop:
//while {
std::stringstream s;
s << "Hello";
font_surface = TTF_RenderText_Solid(font,s.str().c_str(),font_color);
apply_surface(x,y,font_surface,screen);
s << "GoodBye";
if(font_surface = TTF_RenderText_Solid(font,s.str().c_str(),font_color);
apply_surface(bx,by,font_surface,screen);
//end loop }
The problem i have is the output first shows Hello
then in the other location it has HelloGoodBye
, i need to clear the content before i add Goodbye
so i only see that in the second location on screen.
So how would i clear the information of Hello
before I change it to Goodbye
?