I have a small problem with part of a program I have made. I want the user to select a number between 1 and 25 so I have used the following code (which I have abridged):
printf("\nPlease enter the number of records you would like to add (up to 25):\n");
while(number <1 || number>25)
printf("\nPlease re-enter the number of records you would like to add:");
The only problem is when a character is entered it goes into an infinite loop displaying the "Please re-enter...." sentence. Is this because of scanf? Is there a better function to use.
Thanks in advance