www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/28/10:55:21

Message-ID: <372673AA.9D1E8A1C@jps.net>
Date: Tue, 27 Apr 1999 19:34:18 -0700
From: Dennis Yelle <dennis51 AT jps DOT net>
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: <Pine DOT SUN DOT 3 DOT 91 DOT 990418140925 DOT 22615c-100000 AT is> <sMlS2.2355$R93 DOT 22629 AT newsfeed DOT slurp DOT net> <37252A95 DOT 5894 AT arcticmail DOT com> <eH9V2.1527$n5 DOT 4471 AT newsfeed DOT slurp DOT net> <37260199 DOT 6FFD6B6D AT pacificnet DOT net> <9VrV2.132$Sx DOT 1785 AT newsfeed DOT slurp DOT net>
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 <rgesler AT pacificnet DOT net> 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019