Hi,
I'm working on a tic-tac-toe program and one of my modules needs to take an integer value from the user and confirm it was valid integer input and print an error message if it is wrong and prompt the user to enter again.
I am not allowed to use a string and my other issue is that the function prototype has already been defined and needs to be used as is. I would use a IsDigit function and read the value entered as a char and check if it is between char 0 and char 9 but the input (parameters) have to be in int form.
PRE: User has been prompted to enter an integer and min <= max.
POST: an integer value, i, entered by user is returned, where min <= i <= max.
int GetIntInput(int min, int max)
Any ideas would be amazing. I'm just not sure how to do this without a string or reading each value in the input stream as a char.
Thank you!