End of File in stdin
问题 A question about this has been asked here End of File (EOF) in C but it still doesn't completely solve my problem. EOF makes sense to me in any datastream which is not stdin , for example if I have some data.txt file, fgetc() will read all the chars and come to the end of file and return -1 . What I don't understand is the concept of EOF in stdin . If I use getchar() , it will wait for me to enter something, so if there is NOTHING written, End of File, ( EOF ) is not returned automatically?