0
我已經把索姆信息字符串流SS:得到一切從字符串流
stringstream ss (stringstream::in | stringstream::out);
ss<<"abc 456 ";
ss<<123
然後,我決定檢索字符串內容串G:
std::string s;
std::string g;
for (int n=0; n<c; n++)
{
ss >> s;
g=g+s;
}
cout << g <<endl;
爲此,我需要知道多少展示位置已完成到ss。如何知道這一點?檢索字符串信息的方法可能不是很聰明 - 然後給你的方式。
你想'ss.str()'? – BoBTFish
在上面的評論略有擴展:string g = ss.str(); – dutt