Re: EOF in UNIX File

From: Furs Serge <sef_at_kpbank.kemerovo.su>
Date: Mon, 05 Dec 94 08:35:49 +0700
Message-ID: <199412050140.IAA04562_at_mgw.hq.kem>


sarek_at_cais2.cais.com writes:
>
>I am using a while loop to retrieve each character.
>ex.
> while (s=fgetc(file)!=EOF)
>
>Why would this not stop at the end of file in UNIX?
>

Try it:

    while( ( s = fgetc( file) ) != EOF )

          ^^^                ^^^

--------------------------------

Serge Furs from Sibiria (Russia). Received on Mon Dec 05 1994 - 02:35:49 CET

Original text of this message