I have a small part of my program that I would like to revise. The problem is that if someone enters text, it just gets converted to 1 as an int. I would like to print an error message and ask them for an int again.
Thanks in advance,
crab
Code:
{
int in;
cout << endl << "Please input an integer: ";
cin >> in;
Leave a comment: