Let say if I put it this way, when I try to submit a char, it would have return me an error message. But I still couldn't stop the loop from looping. Do I need to flush or anything ? So that the function can stop at the scanf everytime I enter a char ?
Code:while(sel_case != 0) { if ( scanf( "%d", &sel_case ) == 1 ) { switch(sel_case) { case 1: test1(); break; ~ case 10 } else { printf("Wrong input!!"); } }