I'm having problems with this snippet of code:
while(scanf("%d",&numOfPlayers)!=1){
printf("Please enter the right number of players");
}
My purpose is to read a number from the user, and keep asking as long as the input isn't an int. When I run this snippet and input 'r' for example, I get stuck in an infinite loop. What might be the problem, and how can I improve it?