I'm making a program that accept 1 character long strings (and ignores spaces " ") until a user presses return/enter.
So far I have,
int main(){
char expression[1];
while ((scanf("%s",expression)) != EOF){
//code
}
return 0;
}
it is assumed that the user is entering single digit strings (such as "a 1 2 3 d"(enter))
its seems to not like the while condition as it will keep accepting input even after I hit enter. I have tried using -1 instead of EOF but its the same output.
Any ideas?