1)When I use do/while, (QUARTERS >= 1000 ), how do I also make it do while the user input is characters instead of numbers. So if I type "blah" in the input, the program will come out unsuccessful.
2) How do I use bool die to loop the program instead of end it?
// function definition
bool die(const string & msg){
cout << " " << msg << endl;
exit(EXIT_FAILURE); //I want it to loop instead of exit here
}
MY FULL PROGRAM:
<
// This program prompts the number of coins, and outputs how many cents you have
#include <iostream>
#include <string>
using namespace std;
1)When I use do/while, (QUARTERS >= 1000 ), how do I also make it do while the user input is characters instead of numbers. So if I type "blah" in the input, the program will come out unsuccessful.
1 2 3 4 5
do {
// Do something here
} while (QUARTERS < 1) && (QUARTERS > 2147483647);