int main()
{
int choose, isNum;
printf("Choose 1,2,3,4,5,6\n");
isNum = scanf("%d",&choose);
while(choose != 0){
if(!isNum || choose > 6){
printf("Wrong option!\n");
printf("Choose 1,2,3,4,5,6\n");
isNum = scanf("%d",&choose);
continue;
}
//6 ifs checking which number have you choose and what it does..
printf("Choose 1,2,3,4,5,6\n");
isNum = scanf("%d",&choose);
}}
I tried many things from here, fflash, cclear, and at that moment I'm checking first if its a number then using it like many of the answers suggested and it always getting back to the same infinite loop. my question is different because I tried every answers and as I said, it didn't help, not fflush, not cclear and not checking if its a number before using it..