Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

EOF in stdio.h

0 votes
asked Aug 21, 2020 by Sougata Nandy (120 points)
I have been following the examples in Kernighan and Ritchie

How do I invoke the EOF in the examples of the first chapter in this compiler?

The value of EOF in printf statement was -1

I am not able to make the programs in the first chapter work as i  cannot terminate the loop by deliberately keying in the EOF value

1 Answer

0 votes
answered Aug 27, 2020 by Peter Minarik (84,720 points)

Can you share some code so others who do not have the book in front of them would understand what you're trying to do?

Also, maybe this one helps: https://stackoverflow.com/questions/11944314/ctrl-d-didnt-stop-the-whilegetchar-eof-loop

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...