I have a program that will allow the user to perform different actions on a polynomial. One of the actions is multiply. How can I make sure the user is entering a number as a multiplier? If it was an int, i could use isnum(x), but my professor wants us to allow the user to enter a float or double.
CODE
cout << "Enter mulitplier: ";
cin >> x;
while(isalpha(x) || isspace(x))
{
cout << endl;
cout << "You must enter a number!" << endl;
cout << "Enter multiplier: ";
cin >> x;
}
Thanks,
pad0