chars in conditional expression, 3b2 C compiler (Now stdio)

Jim Webb jrw at hropus.UUCP
Fri Jan 2 11:07:49 AEST 1987


> The only thing that really bugs me is the fact that chars are unsigned
> and therefore the following code will fail:
> 
> 	while ((c=getc(stream)) != EOF) putchar(c);
> 
> And you will have to redefine EOF to 255 (0377 or 0xff) or cast it to a char!

Ummm.  I always declare c as an int, not a char, and everything works fine
and dandy...
-- 
Jim Webb             "Out of phase--get help"          ...!ihnp4!hropus!jrw
    "Make sure comments and code agree.  If not, write a man page..."



More information about the Comp.bugs.sys5 mailing list