mixing scanf and gets

Joseph S. D. Yao jsdy at hadron.UUCP
Thu Apr 10 15:40:07 AEST 1986


In article <2476 at brl-smoke.ARPA> rbj at icst-cmr (Root Boy Jim) writes:
>Which brings me to another point. Fgets is worthless on binary
>data. It returns its first argument, which I already know.
>	...  I would like fgets to return the number of chars read.

T h a t  is what fread() is for.  Use it.  Having an element-size
and a number-of-elements is useful when doing, e.g., structure I/O,
otherwise it is a bit of a pain, I'll agree.

[BTW, we have some decent pinball machines down at this end of
Montgomery County, tho I can't recall seeing Big Injun.]
-- 

	Joe Yao		hadron!jsdy at seismo.{CSS.GOV,ARPA,UUCP}



More information about the Comp.lang.c mailing list