2016年11月5日 星期六

c/c++ 以空白分割字串

#include<iostream>
#include<vector>
#include<cstring>

using namespace std;

int main() {

        vector<string> vecStr;
        string strEng = "abc dfg hij";
        int pos;

        while((pos = strEng.find(" ")) != string::npos) {

               ...