getline 28cin string 29 not working

Solutions on MaxInterview for getline 28cin string 29 not working by the best coders in the world

showing results for - "getline 28cin string 29 not working"
Emie
12 Jan 2020
1//Using cin.clear() to ignore any trailing newline character
2string str;
3cin.clear();
4getline(cin, str);