+ 3
What is the difference between cin and getline?
3 Answers
+ 3
cin will take input up to a space.
getline() will take entire input; hence why it is often used for strings.
You need to press return/enter for both...
+ 1
In cin you have to press enter key after entering data
In getline you have to just enter without pressing enter. In pc
In your mobile both are same
0
The getline is a member function of cin for input the whole line into string variable.