I would like my program to only move forward when the enter key is pressed (not any other key).
This is what I have so far:
while (getline(in, line) ) {
cout << line << endl;;
cin.ignore();
}
I would like my program to only move forward when the enter key is pressed (not any other key).
This is what I have so far:
while (getline(in, line) ) {
cout << line << endl;;
cin.ignore();
}
ignore
accepts a delimiter argument:You can use it like this: