Hello everyone, can you help me with this?
In my program, there are some int and double variables. Here is my problem. When users input a double variable for an int variable, I must display an announcement for their mistake. How can I know the type of the value given by users?
I think I'll use string, and check whether it has a dot (.) or not. Do we have any better way?
Thanks for your help!
Am actually a newbie. But I would suggest you include a message telling your users the type of variable to input. For example
cout <<"please input an integer";