[TUHS] v7 K&R C

Clem Cole clemc at ccc.com
Sat May 16 06:05:02 AEST 2020


Ron,

Hmmm... getchar/getc are defined as returning int in the man page and C is
traditionally defined as an int in this code..

On Fri, May 15, 2020 at 4:02 PM <ron at ronnatalie.com> wrote:

> Unfortunately, if c is char on a machine with unsigned chars, or it’s of
> type unsigned char, the EOF will never be detected.
>
>
>
>
>
>
>
>
>    - while ((c = getchar()) != EOF) if (c == '\n') { /* entire record is
>    now there */
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200515/4cece29d/attachment.htm>


More information about the TUHS mailing list