Why cin.getline() function is passed in c++? And what is the rule when we want to use getline() function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why cin.getline() function is passed in c++? And what is the rule when we want to use getline() function?

when my code is full, getline() cant work properly.

25th Nov 2017, 5:50 AM
joelio alex
joelio alex - avatar
11 Answers
+ 4
It may be that your other code contains a cin operation. Then you need to use ignore(). https://www.sololearn.com/discuss/372045/?ref=app
25th Nov 2017, 6:59 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 3
@joelio alex Master? I am not fit to be one, and I am still learning... 😅 Ill be your friend, if you want...
25th Nov 2017, 1:59 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
25th Nov 2017, 5:52 AM
Manual
Manual - avatar
+ 2
I cannot help you with that. You need to show your code.
25th Nov 2017, 6:28 AM
Manual
Manual - avatar
+ 2
@joelio alex Sorry, but I can't share my number. Ill help you here itself, whenever you need it.
25th Nov 2017, 1:53 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 1
@Kinshuk Vasisht: oke, will u be my master?
25th Nov 2017, 1:56 PM
joelio alex
joelio alex - avatar
+ 1
nice offer. yes of course
25th Nov 2017, 2:04 PM
joelio alex
joelio alex - avatar
0
i know that code, but when i put more code on that case, it goes wrong.
25th Nov 2017, 5:54 AM
joelio alex
joelio alex - avatar
0
oke, nice solutions. lets see the result tomorrow
25th Nov 2017, 11:26 AM
joelio alex
joelio alex - avatar
0
kinshuk, may i hv ur whatsapp number?
25th Nov 2017, 11:28 AM
joelio alex
joelio alex - avatar
0
thanks manual
25th Nov 2017, 11:30 AM
joelio alex
joelio alex - avatar