problems with scanf
- by lego69
hello, I've got some problems with this snippet of the code
while(scanf("%d",&numOfPlayers)!=1){
printf("Please enter the right number of players");
}
my purpose is to take the number from the user but if number is not int, I must ask him one more time, when I check this snippet and print 'r' for example I receive eternal loop, what may be the problem, how can I improve it? thanks in advance