Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!ames!ucbcad!ucbvax!decvax!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP Newsgroups: comp.lang.c Subject: Re: is it really necessary for character values to be positive? Message-ID: <600@mcgill-vision.UUCP> Date: Mon, 12-Jan-87 01:15:36 EST Article-I.D.: mcgill-v.600 Posted: Mon Jan 12 01:15:36 1987 Date-Received: Sat, 17-Jan-87 16:22:46 EST References: <39@houligan.UUCP> <289@haddock.UUCP> <548@brl-sem.ARPA> <293@haddock.UUCP> Organization: McGill University, Montreal Lines: 29 In article <293@haddock.UUCP>, karl@haddock.UUCP (Karl Heuer) writes: > [Your suggestion] supports my contention that making getchar() an int > function was a mistake in the first place.** > **I do have what I think is a better idea, but I'm not going to > describe it in this posting. How about in another posting then? What I normally do is something more like char c; /* yes, char! */ .... c = getc(stream); /* or getchar() if stdin */ if (feof(stream) || ferror(stream)) { .... } ie, *ignore* the EOF return and check explicitly. Is this better? worse? than the int c; c=getc(stream); if (c==EOF) approach? Why? der Mouse USA: {ihnp4,decvax,akgua,utzoo,etc}!utcsri!mcgill-vision!mouse think!mosart!mcgill-vision!mouse Europe: mcvax!decvax!utcsri!mcgill-vision!mouse ARPAnet: think!mosart!mcgill-vision!mouse@harvard.harvard.edu