详细例子如下:
#include <bits/stdc++.h>
#include <vector>
#include <string>
using namespace std;
int main(){
string str = "hello world I'm Frankie";
string word;
vector<string>colls;
stringstream stream_buf(str);
while(stream_buf >> word){
colls.push_back(word);
}
for(string v : colls)
cout<<v<<endl;
}