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 ?

1/11/2019 1:04:41 PM

Zeshan Ahmed

1 Answer

New Answer

+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.