I have this simple function that parses a sentence into a vector of strings. It works, despite the fact I can't make it user driven and have to set src manually. No, this is not homework, I'm willfully creating a scripting language.
int main(){
string src, word;
vector<string> sent;
cout<<"enter script"<<endl;
cin>>src;
istringstream extract(src); ///extract word between space
cout<<src<<endl;
for(int i=0;i<30;i++){cout<<"_";}
cout<<endl;
while(extract >> word)
{
sent.push_back(word); ///sentence vector
}
for(auto itr:sent)
cout<<itr<<endl;
return 0;
}