Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: while loop vs do while loop reading from the file issue Date: Thu, 15 Dec 2016 11:48:30 -0800 Organization: None to speak of Lines: 27 Message-ID: References: <52f1c174-6af1-4fda-9ff8-a5e2cf507b5f@googlegroups.com> <87bmwgpxbs.fsf@bsb.me.uk> <87mvg0o6hk.fsf@bsb.me.uk> <87y3zj8j94.fsf@bsb.me.uk> <87k2b38dod.fsf@bsb.me.uk> <87d1gu774w.fsf@bsb.me.uk> <8737hp5v0i.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="d13fb784dfa5b4f5223d68f3ab06c5fb"; logging-data="11406"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/w6d8DturYDj7EfHQq8M+d" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:+ExCXz32wqrF69hSRt28ffQrCkU= sha1:kh4xz1L8zwxrK19sKO1GL/vNNUE= Xref: csiph.com comp.lang.c:99552 BartC writes: > On 15/12/2016 10:47, Ben Bacarisse wrote: >> BartC writes: >>> My original eof() function actually checked whether the current file >>> position was at the end of a file. > >> How do you tell that the position it at the end with interactive input? >> C's method allows you to write programs that work with interactive input > > as easily as file input (and streams, and network connections etc, > > etc). > > You mean Unix's method. I'm pretty sure he means C's method (which, historically, is closely tied to Unix, but works on non-Unix systems). > I deal separately with files and interactive input. C's I/O model is designed so that you don't have to. [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"