home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.aix
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!univ-lyon1.fr!chx400!aragorn.unibe.ch!iacrs1!haedener
- From: haedener@iacrs1.unibe.ch (Konrad Haedener)
- Subject: Re: Simple EOF problem?
- Message-ID: <1992Nov18.074916.2886@aragorn.unibe.ch>
- Sender: haedener@iacrs1 (Konrad Haedener)
- Reply-To: haedener@iacrs1.unibe.ch
- Organization: University of Berne
- References: <BxvzEE.79B@acsu.buffalo.edu>
- Date: Wed, 18 Nov 1992 07:49:16 GMT
- Lines: 33
-
- In article <BxvzEE.79B@acsu.buffalo.edu>, vidya-v@acsu.buffalo.edu (vidyaranya) writes:
- |>
- |> The following piece of code FAILS to detect End of File
- |> under AIX(i dont know the version currently!) running on
- |> an IBM PowerServer 970.
- |> ------
- |> char buffer[2048];
- |> int i;
- |> FILE *fp;
- |>
- |> i=0;
- |> while( (buffer[i++]=fgetc(fp))!= EOF )
- |> ;
- |> ------
- |> Exactly same piece of code runs on a SparcStationIPC running
- |> SunOS 4.1.2 .
- |>
- |> What could be the problem?
-
- fgetc returns int.
- EOF is (-1).
-
- |>
- |> Thanks.
- |>
- |> Vidyaranya
- |> vidya-v@acsu.buffalo.edu
-
- --
- Konrad Haedener Phone: +41 31 65 42 25
- Institute for Physical Chemistry FAX: +41 31 65 39 94
- University of Berne
- Switzerland haedener@iacrs1.unibe.ch
-