把字符串作为像CIN一样的输入源
头文件<sstream>
string s="123 qwe 12";
stringstream sin(s);
int a;
string ts;
int b;
sin>>a>>ts>>b;
cout<<a<<" "<<ts<<" "<<b<<endl;
把字符串作为像CIN一样的输入源
头文件<sstream>
string s="123 qwe 12";
stringstream sin(s);
int a;
string ts;
int b;
sin>>a>>ts>>b;
cout<<a<<" "<<ts<<" "<<b<<endl;