2个回答
展开全部
vector<string> container;
vector<string>::iterator pos;
string str("She wants to go to Peking University to study Chinese"),token;
while((index = str.find_first_of(' ',t_index)) != -1)
{
if(t_index == 0)
container.push_back(str.substr(0,index));
while(str[index] == ' ')
index++;
t_index = index;
vector<string>::iterator pos;
string str("She wants to go to Peking University to study Chinese"),token;
while((index = str.find_first_of(' ',t_index)) != -1)
{
if(t_index == 0)
container.push_back(str.substr(0,index));
while(str[index] == ' ')
index++;
t_index = index;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询