Mail Archives: djgpp-workers/1997/12/17/07:38:22
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
- Raw text -