In message <QMDub.6596$. net>
"Mike Wahler" <> wrote:
> "Alan Connor" <> wrote in message
> news:KfDub.5447$ ink.net...
> > On Tue, 18 Nov 2003 22:39:09 -0600, Morris Dovey <> wrote:
> >
> > > K&R attempts (and succeeds) in providing a /succinct/
> > > presentation of the language. Messrs Kernighan and Ritchie
> > > /don't/ spoon feed the reader; they expect us to read with our
> > > brains fully engaged.
> >
> > That's a strange way to put it: "spoon feed".
> >
> > It is a book written for people who already know how to
> > program and want to learn C.
> >
> > No amount of "brain engaging" could EVER have arrived at
> > the use of Ctrl-c or Ctrl-d for that program.
>
> Because neither of those 'keystrokes' (or any others)
> are defined by the language. They're defined by the
> host operating system.
Not necessarily. My OS doesn't have a concept of EOF for terminal input
at all. C assumes one for trivial programs like that, so the C library
itself decides to follow the Unix Ctrl-D convention. I'd agree that this
should be in the FAQ - for many non-Unix systems, terminal EOF is a purely
"C" concept.
I'd been using C for over a year on my platform before I found out about
Ctrl-D; I'd hitherto assumed that EOF wasn't possible on stdin.
--
Kevin Bracey, Principal Software Engineer
Tematic Ltd Tel: +44 (0) 1223 503464
182-190 Newmarket Road Fax: +44 (0) 1223 503458
Cambridge, CB5 8HE, United Kingdom WWW:
http://www.tematic.com/