I am working on a program that invites the user to input a date:
m for month, d for day and y for year.
These input values will be used in the program to do a series of calculations.
I am at the stage where the input is checked for errors (I found 7 possible errors).
And verifying that everything was OK i found an 8th possible error and that is the subject of this post.
To avoid laying everything out, let's look at the input for the month.
In main() you have:
int m;
cout << "Input the number for the month and press the ENTER key: ";
cin >> m;
.
.
.
suppose the user instead of inputting, for ex., 10 inputs 1o
suppose the user instead of inputting, for ex., 10 inputs 1o
If you're want to catch the user entering alphas, you're going to have to read the input as a string and do your own numeric editing, then convert to an int.