Hey guys is there anything wrong with how im getting the input for a single character because for some reason the if statement is not working properly.
Even if i do enter the correct input it still prints as invalid?
Code:char guessType() { char type; int valid; printf("Enter guess type((f)lag, (u)ncover or(s)weep:\n"); valid = 0; while((type = fgetc(stdin) != '\n' && type != EOF)) { if(type != 's' || type !='u' || type != 'f') { printf("invalid"); } break; }