L
linyanhung
In case A(see below), ss.clear() doesn't work and have no error
message. cout<<ss.str() shows "xcv".
In case B ss.clear() works normally and cout<<ss.str() shows
nothing.
Can anyone tell me why ? Thanks.
Case A:
stringstream ss;
ss<<"xcv";
{
ss.clear();
cout<<ss.str();
}
---------------------------
Case B:
{
stringstream ss;
ss<<"xcv";
ss.clear();
cout<<ss.str();
}
message. cout<<ss.str() shows "xcv".
In case B ss.clear() works normally and cout<<ss.str() shows
nothing.
Can anyone tell me why ? Thanks.
Case A:
stringstream ss;
ss<<"xcv";
{
ss.clear();
cout<<ss.str();
}
---------------------------
Case B:
{
stringstream ss;
ss<<"xcv";
ss.clear();
cout<<ss.str();
}