Answers for "how to use cin.getline for strings"

C++
1

cin.getline

cin>>n;
cin.ignore();
cin.getline(cin,string,'\n');
Posted by: Guest on September-28-2020
0

getline(cin string) not working

//Using cin.clear() to ignore any trailing newline character
string str;
cin.clear();
getline(cin, str);
Posted by: Guest on July-30-2021

Code answers related to "how to use cin.getline for strings"

Browse Popular Code Answers by Language