64,637
社区成员
发帖
与我相关
我的任务
分享
string str = "Hear from your industry peers and share your experiences at Oracle Industry Connect";
vector<string> words;
istringstream iss(str);
copy( istream_iterator< string >( iss ), istream_iterator< string >(), back_inserter( words ) );
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
int main()
{
string str = "Hear from your industry peers and share your experiences at Oracle Industry Connect";
vector<string> words;
istringstream iss(str);
string word;
while (iss >> word)
{
words.push_back(word);
}
cout << "words in vector :" << endl;
for (string word : words)
{
cout << word << endl;
}
return 0;
}