Message-ID: <372673AA.9D1E8A1C@jps.net> Date: Tue, 27 Apr 1999 19:34:18 -0700 From: Dennis Yelle X-Mailer: Mozilla 4.51 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Challenge for C++ programmers: References: <37252A95 DOT 5894 AT arcticmail DOT com> <37260199 DOT 6FFD6B6D AT pacificnet DOT net> <9VrV2.132$Sx DOT 1785 AT newsfeed DOT slurp DOT net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 209.239.208.246 X-Original-NNTP-Posting-Host: 209.239.208.246 X-Trace: 28 Apr 1999 03:16:29 -0700, 209.239.208.246 Lines: 37 X-Original-NNTP-Posting-Host: 209.63.224.240 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com bowman wrote: > > Ralph Gesler wrote in message > news:37260199 DOT 6FFD6B6D AT pacificnet DOT net... > > > > All errata for Stroustrup's 3rd edition, up through the 9th printing are > > available at http://www.research.att.com/~bs/3rd_errata.html. > > thanks for that link. Now, if I could get sed to work on hardcopy books > ..... > > > "Note that on some systems, it can be hard to determine if input > > is available. > > Thus, in_avail() might be (poorly) implemented to return 0 > > in cases where an input operation would succeed." > > I didn't spend too much time playing with it, and I must confess I can't > recall which compiler I was using (CygWin or DJGPP g++, or Ming's egcs), but > the behavior I saw was consistent with in_avail() always returning 0. I > guess a little more controlled test is in order. I took a quick look at the header file for DJGPP and in_avail() just tells you how many characters are buffered by the stream, it never tries to see if there are any more in the keyboard buffer or on the disk. Here is the relevant line from the header file: int in_avail() { return _IO_read_end - _IO_read_ptr; } I guess that is not EXACTLY useless, but it is far from what I had hoped for. Dennis Yelle -- Want to get paid for using the internet? If so, go to: http://alladvantage.com/go.asp?refid=BAL536