EOF & Learning C

From: Tom Kenyon (t.kenyon_at_gmail.com)
Date: 11/18/04


Date: 18 Nov 2004 14:14:54 -0800

I have been playing around with the early example found in 'The C
Programming Language' (Second Edition). When I compile the examples
(using gcc on OS X) included within the book for line or character
counting utilities I always find myself unable to terminate the
application (and therefore unable to recieve the result of the
line/character count). The code shows that it will terminate when
'EOF' is inputted, however this never seems to occur. Pressing the
enter key just makes a newline and dosen't terminate the application
or show me any results. What exactly is the function of EOF? And how
is it triggered by the user?



Relevant Pages