I have this loop, but when i hit enter after my character, it processes it and then processes the '\n' before asking for input again. Please!!!! Help
int input;
while (true){
input = getchar();
fflush(NULL);
input = input - '0';
if( input != 'e' && input != '\n') {
rc = state_fun(input);
}
5[ENTER]
processes 5 as input, then 10 (which is ascii '\n') as input, then requests input again. It is driving me nuts