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 !
1 Answer
+ 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.