Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!ericom!eos.ericsson.se!epames From: epames@eos.ericsson.se (Michael Salmon) Newsgroups: comp.lang.c Subject: Re: What's so bad about scanf anyway??? (really what's bad about gets) Message-ID: <1990Nov22.071319.3222@ericsson.se> Date: 22 Nov 90 07:13:19 GMT References: <4319@goanna.cs.rmit.oz.au> <1990Nov20.123036.11103@ericsson.se> <3797@skye.ed.ac.uk> Sender: news@ericsson.se Reply-To: epames@eos.ericsson.se Organization: Ericsson Telecom AB Lines: 17 In article <3797@skye.ed.ac.uk> richard@aiai.UUCP (Richard Tobin) writes: >You seem to have misunderstood Richard O'Keefe's point. By EOF, >Richard meant the C #defined constant, normally -1. By , he >meant the key you press to send end-of-file (perhaps ^D), which is why >he said: > >>>Let 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, the same as your ERASE etc. characters are special commands to the tty driver. By typing ^D when there are no characters in the input buffer you are sending 0 characters which is the end of file condition. Michael Salmon L.M.Ericsson Stockholm