print #include
#include
#include
using namespace std;
int main()
{
string test = "aa aa bbc cccd";
vector
string strtemp;
string::size_type pos1, pos2;
pos2 = test.find(' ');
pos1 = 0;
while (string::npos != pos2)
{
strvec.push_back(test.substr(pos1, pos2 - pos1));
pos1 = pos2 + 1;
pos2 = test.find(' ', pos1);
}
strvec.push_back(test.substr(pos1));
vector
while (iter1 != iter2)
{
cout << *iter1 << endl;
++iter1;
}
return 0;
}
#include
#include
#include
using namespace std;
int main()
{
string test = "aa aa bbc cccd";
vector
string strtemp;
string::size_type pos1, pos2;
pos2 = test.find(' ');
pos1 = 0;
while (string::npos != pos2)
{
strvec.push_back(test.substr(pos1, pos2 - pos1));
pos1 = pos2 + 1;
pos2 = test.find(' ', pos1);
}
strvec.push_back(test.substr(pos1));
vector
while (iter1 != iter2)
{
cout << *iter1 << endl;
++iter1;
}
return 0;
}