How it got "broke"...

Chris Sylvain don at umd5
Wed Oct 22 01:59:17 AEST 1986


[]
Why "while( fputc(fgetc(fd), fe) != EOF )" quit working as it
did under both 2.9BSD and Ultrix 1.2 ...
1)  At the end of file, fgetc() returns (int) -1.
2)  fputc() prints (char) -1 and then returns a CHAR not an INT.

Naturally, (int) -1 != (char) -1, so we have a problem.
Question is now: can I deduce that under 2.9BSD and Ultrix
in the above code fragment there is an implied cast, i.e.,
(char) EOF or (int) fputc() ?

[thanks to everyone who responded to the previous posting.]
-- 
--==---==---==--
.. O frabjous day! Callooh! Callay! ..

ARPA: don at umd5.UMD.EDU     BITNET: don%umd5 at umd2
UUCP: ..!{ seismo!umcp-cs, ihnp4!rlgvax }!cvl!umd5!don

** WARNING: don at mimsy.UMD.EDU is a different person **
** (umcp-cs and mimsy.umd.edu are the same machine) **
**   -->   Please double-check the address   <--    **



More information about the Comp.lang.c mailing list