0

cin is only used with int type, does it work with text too?

what is the result of this when the user input text : int a; cin >>a; thank you !

10th Aug 2016, 3:46 PM
Raphael Reme
Raphael Reme - avatar
1 Réponse
+ 1
cin can be used for any character as long as the variable is the correct type. For integers, you should only input whole numbers; if you input anything else, you'll get an error. If you want to input letters, you need a string variable.
10th Aug 2016, 11:40 PM
Joshua MacIntyre
Joshua MacIntyre - avatar