Why use cin.get while cin>> seems fine | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 19

Why use cin.get while cin>> seems fine

am still a begginer...dont get all geekyšŸ™„šŸ™„

10th Aug 2017, 11:19 AM
Lawrence Muema (šŸ˜³šŸ˜Œ)
Lawrence Muema (šŸ˜³šŸ˜Œ) - avatar
2 Respostas
+ 13
cin.get extracts characters from the input stream and store them as a c-string. http://www.cplusplus.com/reference/istream/istream/get/
10th Aug 2017, 11:30 AM
Hatsy Rei
Hatsy Rei - avatar
+ 5
cin.get() is a built-in method with three overloads, purposely for character inputs. it reads every character you enter including space and newline. the stream extraction operator >> is overloaded for any type, and can also be overloaded for user-defined types. it terminates on reaching a space or newline on input.
13th Aug 2017, 2:21 PM
Germain F
Germain F - avatar