+ 1

How do I check that the user has entered integer/character as input so that I can store it in a variable of the same type

so lets say i ask a user for input, "type in a number". so basically i want to store the input depending on the type. for example: int x; char y; double z; cout << "enter your number"; so i want to test and if it is an integer, it goes to x if it is a character, it goes to y if it is a decimal, it goes to z and if it is a fraction, it goes to a

19th Jun 2020, 12:00 PM
varun
varun - avatar
1 Odpowiedź
+ 3
I think you should ask first about data type
20th Jun 2020, 5:38 AM
vaibhav
vaibhav - avatar