0
Morgan 201128374 4383745,12394 5455.30
drew 22223 91939,5324 55.9
stringstream strm;
sstream strm(s)
strm.str() return a copy of a string
strm.str(s) copies the string into strm return void.
我在为Stringstream分配变量时正在寻找更多的函数。我将如何忽略标点符号?我的书只列出了上面的两个函数。stringStream函数
struct PersonInfo{
string name;
vector<string> numbers;
}
string line, word;
vector<PersonInfo> people;
while(getline(cin, line))
{
PersonInfo Info;
istringstream record(line);
record >> info.name;
while (record >> word)
info.numbers.push_back(word);
people.push_back(info);
}
http://www.cplusplus.com/reference/sstream/stringstream/ – Steephen