Hi, i'm making a for loop for a mini game which required the user to enter the input number.Let say if the user accidently entered a character instead of integer the whole program will go haywire so is there anyway to check for the error and prompt the user to input the data again?
Here is the simple program...
You could read in the input as a character string, then have your program parse it's content, determine whether it is properly defined data for your program, and then convert the content to integers and assign it to the appropriate data structure in your program.