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

Michael Salmon epames at eos.ericsson.se
Tue Nov 27 22:00:05 AEST 1990


In article <3819 at skye.ed.ac.uk> Richard Tobin writes:
>In article <1990Nov22.071319.3222 at ericsson.se> epames at eos.ericsson.se writes:
>
>>>>>Let <EOF> represent your end-of-file character on a UNIX system
>
>>^D is *NOT* an eof character, it is a command to the tty driver to send
>>the contents of the input buffer,
>
>I thought I had made it quite clear what happens when you type ^D.
>
>Are you trying to make a substantial point here, or are you just 
>quibbling about the term "end-of-file character"?

I think that the substantial point is that there is no "end-of-file
character". End of file is a read() of zero characters, when reading
from a terminal this can be achieved by typing ^D (usually) with a
blank line. The end of file indication requires both conditions.
Getting back to gets(), it behaved exactly as I expected it would and
as the manuals say it should.

Solely the opinion of
    Michael Salmon
    L.M.Ericsson
    Stockholm



More information about the Comp.lang.c mailing list