Hello, I am really new to C++ and I made a program that does addition (It's my first program). The problem, is, it glitches when you input a letter. I can't seem to figure out how to fix it. Can anyone help? here's the program so far:
This is where new users get bit. User input is not easy.
You must read everything the user typed in before pressing ENTER, and then
attempt to validate that as an integer (or whatever you are looking for). Complain if the user goofs up and continue otherwise.
Here is my standard example of how to do it. http://www.cplusplus.com/forum/beginner/13044/#msg62827
It uses a fancy templated class to make the code to get input pretty, but that isn't the point. The important stuff is on lines 28 through 41 and the loop in main().