Another noob'quest | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 4

Another noob'quest

Does the function 'cin' only recice input as numbers ?

17th Mar 2018, 2:46 PM
SlightlyWind
SlightlyWind - avatar
5 Réponses
+ 2
nope it can receive input of any data type but you must declare your variable in that data type before using it in cin
17th Mar 2018, 2:58 PM
‎ ‏‏‎Anonymous Guy
+ 3
no, it can recive all data types.
17th Mar 2018, 2:58 PM
abdallah diouane
abdallah diouane - avatar
+ 3
@phong its ok that you asked this question but in future try to experience these things on your own. You may try use char with cin. This will help in developing an attitude for scenarios where it is not feasible to ask others. Anyways if you encounter some problem you can always ask others(as you did this time).good luck.
17th Mar 2018, 3:27 PM
shobhit
shobhit - avatar
+ 2
k thx
17th Mar 2018, 3:04 PM
SlightlyWind
SlightlyWind - avatar
+ 2
No, cin recieves input of all data types
18th Mar 2018, 6:58 AM
blue
blue - avatar