Checking input in a while loop...
This is what I have for this particular function so far...
it works perfectly fine if I enter a number. but if i enter a character or letter or something, i was expecting it to reprompt, but instead it goes into an infinite loop of prompting and error messages. Can someone explain why? How can I fix it?
unsigned long getNum(char prompt)
unsigned long darts;
while((scanf("%lu", &darts)) != 1)
printf("\n\nThis is not an acceptable entry. please try again.\n");