Article View: net.micro.atari16
Article #2365(none)
From: DeCorte Michael R
Date: Thu, 16 Oct 1986 23:02
Date: Thu, 16 Oct 1986 23:02
24 lines
1334 bytes
1334 bytes
The complaint was the ?Megamax C? had problems with the following code
unsigned x;
while ((x=getchar) != EOF) { ... }
the complaint was the it went into an infinite loop.
while if x was just an int everything was fine.
He gave an idea that it may have had to do with the
sign extending of char to int.
well the problem acctully is I believe (I don't
have or use magamax c so this is an educated guess)
if you look in STDIO.H you will see that
EOF is declared to be -1.
some c systems use -1 others use 0 i believe.
well the whole point is that -1 is legal and
SOMEWHERE in KR it says so you can have the fun
looking for the little blurb. I seem to
remember it being in the second chapter and
never did see it in the definition if you
really want to find it.
Michael DeCorte
fi46@clutx
l40a@clutx
Technical Details
Message-ID:
<8610162302.AA26640@clutx.CLARKSON.EDU>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!clutx.BITNET!l40aShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!clutx.BITNET!l40a From: l40a@clutx.BITNET (DeCorte Michael R) Newsgroups: net.micro.atari16 Subject: (none) Message-ID: <8610162302.AA26640@clutx.CLARKSON.EDU> Date: Thu, 16-Oct-86 19:02:18 EDT Article-I.D.: clutx.8610162302.AA26640 Posted: Thu Oct 16 19:02:18 1986 Date-Received: Fri, 17-Oct-86 03:56:11 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 24