getchar and EOF (was: One more point regarding = and == (more flamage))

Rahul Dhesi dhesi%cirrusl at oliveb.ATC.olivetti.com
Tue Apr 9 06:09:40 AEST 1991


In <1991Apr7.064003.8552 at athena.mit.edu> scs at adam.mit.edu (Steve Summit) writes:

>As a return value from getchar, EOF is guaranteed to
>be distinct from all char values.

I have always assumed that EOF is guaranteed to be -1.  I think there
is enough history behind EOF == -1 (just as with NULL == 0) that it
isn't likely to be anything else.
--
Rahul Dhesi <dhesi at cirrus.COM>
UUCP:  oliveb!cirrusl!dhesi



More information about the Comp.lang.c mailing list