Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!sharkey!cfctech!ttardis!rlw From: rlw@ttardis.UUCP (Ron Wilson) Newsgroups: comp.sys.apple Subject: Re: HyperC Message-ID: <2470@ttardis.UUCP> Date: 12 Feb 90 18:12:16 GMT Organization: Gallifrey Lines: 24 In article , pnakada@oracle.com (Paul Nakada) writes: >In article <14121@reed.UUCP> reeder@reed.UUCP (Doug Reeder) writes: > > Since EOF is not defined, even in std.h, how do you detect the end of > files? > >[ > EOF can be either -1 or 255. Here are some hypotheses. the > getchr() function returns a signed char in which case you want to > compare its result with -1. When i tried to assign getchr() to a > char and then check, I had to compare with 255. So, I guess that > the default char is an unsigned char. I have yet to try, but I bet > that assigning getchr() to a signed char will alleviate the problem. > > So. EOF = -1 and getchr returns signed char. >] Actually, getchr (should be getchar) PROBABLY returns an integer - this is the way it is defined on MOST Un*x C compilers and also MS, Lattice, and Aztec C compilers for MS-DOS. As I recall, Aztec C for the Apple ][ also defines getchar as returning an integer. - Ron Wilson