What's so bad about scanf anyway??? (really what's bad about gets)

Michael Salmon epames at eos.ericsson.se
Fri Nov 23 20:23:42 AEST 1990


In article <4354 at goanna.cs.rmit.oz.au> Richard A. O'Keefe writes:
>I wrote
> Let <EOF> represent your end-of-file character on a UNIX system
>
....
>
>The SVID release 2 has the same text, and speaks of
>	The ERASE, KILL, and EOF characters ...
>
>So when I wrote of an "end-of-file character" I was using *precisely*
>the terminology blessed by the SVID, which nowhere calls it a "command".

I agree that that is what the manual says and I think it is unfortunate
as it doesn't mean end of file as defined by gets() etc. I quote below from
SunOS man page for termio.

     EOF       (CTRL-D or ASCII EOT) may be used to  generate  an
               end-of-file  from  a terminal.  When received, all
               the characters waiting to be read are  immediately
               passed  to the program, without waiting for a NEW-
               LINE, and the EOF is discarded.   Thus,  if  there
	       are no characters waiting, which is to say the EOF
               occurred at the beginning of a line, zero  charac-
               ters  will  be  passed back, which is the standard
               end-of-file indication.

Strictly my own opinions.
    Michael Salmon
    L.M.Ericsson
    Stockholm



More information about the Comp.lang.c mailing list