From: molnarl AT cdata DOT tvnet DOT hu Date: Wed, 17 Dec 1997 13:37:02 +0100 (MET) To: Vik Heyndrickx cc: djgpp-workers AT delorie DOT com Subject: Re: char != unsigned char... sometimes, sigh In-Reply-To: <3497B2AC.5E0A@rug.ac.be> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Wed, 17 Dec 1997, Vik Heyndrickx wrote: > int a ='\x84'; > int b; What's wrong with "int a=0x84;" ? :-) > b = getc (f); // f is a text file with the next character to read 0x84 [] > The reason is that getc returns a value in the range [0..255] or -1, and > chars are signed on this platform. > Since getc is only supposed to be used for text files, I think we should > change it to return chars in the range [-128..127], so that comparisons > work. I think this is a bad idea, because most programs assume that EOF is -1. Laszlo