Going through K&R, I'm trying to get my head around C. I want to write a program that prints on the screen the user's previous line, unless the character was "a".
int main(){
int c;
while((c=getchar())!=EOF){
if(c!='a')
putchar(c);
}
return 0;
}
Yes, the program isn't much. But it won't work as intended. Do I need to use the ASCII value of the character "a", because the above code just prints all the letters regardless of being a or not.