I need to find out, because my program deals with numbers, how to block characters from being inputted.
Such as,
int input;
cout<<"Please type in a number."<<endl;
cin>>input; //input should be a number. A letter? Oh no.
if the input would have been a character, BOOM! Program == Dead.
What would be the line of code that blocks the input of characters.
So, could someone help me with this. I've been having problems with it for a long time now, and I want to eliminate that hurdle from my programs forever.