Hi, I'm working on my school project and having an issue with using cin.clear.
I want the users to input only the number (choices of 1,2,3 or 4).
Below is the code that I am working on.
If I run the program and enter invalid choice such as characters, then the program asks the user to input valid data.
But my problem is if I enter something such as 3a, then the program runs option 3...
How do I fix this problem? Please help!
int main()
{
//declare variables
int scores[SIZE];
//read data from file and retrieve size
int size = readData(scores);
if (size>0)
{
bool flag = true;