I am trying to take user input (strings) and store them in a vector . but this while cin
doesn't stop taking user input. I know there is a getline()
function etc. also but why does while getline or while cin dont stop taking user input? any solution?
string word;
vector <string> text;
while (cin >> word) {
text.push_back(word);
}