im brand new to c++, so i was wondering if someone could help me with my calculator program.
it starts out by printing this on the screen:
1. Addition
2. Subtraction
3. Multiplication
4. Division
Choose one:
The user chooses one of the operations by entering the number.
It runs fine and all, except for one thing. When the user inputs a character or a string of characters, the program starts repeating itself at a very rapid rate.
instead of getting all screwed up, i am trying to figure out how to make the program print an error message like: "Thats a letter, not a number" or something.
the problem is, my variable for the user input is a float variable. is there some way for a variable or an array to be able to handle 2 different types, such as char and int.
ok i hope that came across in an understandable way