How do I input a string then output a vector from this function? The compiler doesnt seem to like "while(invector>>word)".
vector<string> example (string invector);//prototype
vector<string> example(string invector)
{
string word;
stringstream insert(invector);
vector < string > vectemp;
while(invector >> word)
vectemp.push_back(word);
for(int i = 0; i < vectemp.size(); i++)
cout << vectemp[i] << endl;
return(vectemp);
}