I am making a system where the user inputs numbers on the console and add them eventually. The problem I have is, if the user inputs a character rather than a number, the program would tell there is an error or it can not add because there was a character inserted on the system. I made the system with if-else-else-if, but that took me ages to code since I placed || functions like for example:
if (x=="a" || x=="b" || x == "c" ) ....
and so on…
Is there a way for C++ to detect that if the input value is a character or a string, the program would have an error.
Hint:
will tell you if
xis between'a'and'z'(similar for capital letters).