I'm trying to get the user to input their 5 digit zip code but my problem is how can I stop the program after the five characters have been inputted. Also how can I only get numbers to be inputted cause so far letters can be inputted as well.
int ZipCode;
cout << "Please Enter 5 Digit Zip Code:";
cin >> ZipCode;
the problem is I used cin.fail to make sure numbers are entered but if I input something like 9had it doesn't fail since the first character is a number.