+ 2

Why do we use getline, can't we just cin for that?

What is main difference in them and what are advantages of using getline function.

6th Nov 2016, 5:38 PM
Muhammad Hamza
Muhammad Hamza - avatar
2 Antworten
+ 3
Cin gets only first word of input while getline function gets the whole line Including spaces and other characters.
19th Jan 2017, 4:59 PM
Muhammad Hamza
Muhammad Hamza - avatar