谁来解释下先!
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main()
{
stringstream ostr;
ostr<<"This is stringstream";
string gstr = ostr.str();
cout<<gstr<<endl;
char a;
ostr>>a;
cout<<a ;
cout<<endl;
return 1;
}
[解决办法]
就是输入输出,没有啥好解释的!看他的操作符就很清楚了,
[解决办法]
就是教你如何使用stringstream对象进行字符串的输入输出的操作,以及和string对象的转换。