I want to Know that is there any way to get input from user without data type in C or C++. Generally we take any variable and store input in that particular variable.
I want to check data type of input after getting from user.
I want to Know that is there any way to get input from user without data type in C or C++. Generally we take any variable and store input in that particular variable.
I want to check data type of input after getting from user.
You don't need to "check data type of input after getting from user" because the type of all input from user is C-string, known in advance. If you want to treat it differently, e.g. to convert "0.1" to double
, the compiler has not idea how to do this. You should provide this info, e.g. you can request user to input what type it should be converted to and a value. Or to implement rules of automatica conversion specific for your application.