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
Expand|Select|Wrap|Line Numbers
- {
- int in;
- cout << endl << "Please input an integer: ";
- cin >> in;
- cout << "The int entered was : " << in;
- }