getchar() or putchar() keeps eating the first character of my input
问题 edit: this question is solved. thank you for all answers This is my program: #include <stdio.h> int main(){ printf("write something : \n"); int c = getchar(); while((c = getchar()) != EOF){ if (c == ' ' || c == '\t') printf(" \n"); else putchar(c) } return 0; } everytime i run it, it works fine, but eats the first character of my input for example when i run the program the output looks like this: write something : this is a sentence. his is a sentence. the "t" is missing. why is that