Hi everyone, I recently started programming with C++ and I created a program that acts as a simple calculator that does basic arithmetic. The program works fine except for one thing that is really bothering me. This occurs when I ask the user to input the first number they would like to add, multiply, subtract, or divide from. Basically the program works fine if they input a number that can be assigned to the integer, but if they input anything but a number I get a big long scrolling block of text that doesn't do anything until I eventually close the program. Heres an example in case my explanation wasn't clear.
cout << "Enter the first number you would like to add, subtract, multiply, or divide from:";
cin >> firstNum;
When they enter a letter or a character for firstNum the program goes nuts, is there any way to force the user to enter a number?