Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Promoted
This program is showing - 1 when eof is printed. But loop is not getting terminated by typing - 1. Why?

1 Answer
Relevance
- BillLv 73 years agoFavorite Answer
Typing -1 is not the same as EOF. The getchar() function returns a character code when a key is pressed, or it returns EOF when a special key is pressed, usually ^D. If standard input is redirected to a file, getchar returns EOF when it reaches the end of the file.
Still have questions? Get your answers by asking now.


