What is the difference between getchar () and getline () ? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 4

What is the difference between getchar () and getline () ?

And cin when we read line ?

11th Jan 2019, 1:04 PM
Zeshan Ahmed
Zeshan Ahmed - avatar
1 ответ
+ 1
This is a good answer for the gets: https://www.daniweb.com/programming/software-development/threads/444375/getline-vs-getchar string s; cin >> s; Only reads to the first whitespace character so words from the line.
11th Jan 2019, 4:29 PM
John Wells
John Wells - avatar