delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/09/02/18:12:03

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Fri, 3 Sep 2004 00:11:57 +0200
From: Egon Eckert <egon AT heaven DOT industries DOT cz>
To: djgpp AT delorie DOT com
Subject: Re: scanf: strange behavior?
Message-ID: <20040902221157.GB7970@webhome.cz>
References: <20040902144152 DOT GH6858 AT webhome DOT cz> <2pp00iFnf7nsU1 AT uni-berlin DOT de> <41374c9c$0$173$cc7c7865 AT news DOT luth DOT se> <20040902184005 DOT GA23943 AT webhome DOT cz> <41378A42 DOT 5040801 AT acm DOT org> <200409022144 DOT i82LiDLe005751 AT envy DOT delorie DOT com>
Mime-Version: 1.0
In-Reply-To: <200409022144.i82LiDLe005751@envy.delorie.com>
User-Agent: Mutt/1.5.5.1+cvs20040105i
Sender: Egon Eckert <egon AT webhome DOT cz>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > But: the use of the code above would be to collect arguments passed to 
> > the command line _except_ yours have no variable to collect!
> > 
> > Since you have put in the body of your main, is no longer a prototype!
> 
> You apparently don't understand C++ enough.

Thank you for my defence.  It's hard for me (without a brand name in
this mailing list) to defend against acm.org member ending each
sentence with an exclamation mark. :)

Anyway, reading this again and again (libc.inf/scanf)--

Return Value
------------

The number of items successfully matched and assigned.  If input ends,
or if there is any input failure before the first item is converted and
assigned, `EOF' is returned.

-- I'm becoming more and more confident, that it's actually
inconsistent with the current implementation.

To return EOF, the input has to end *before* the first item
converted/assigned, because when it has to end otherwise?  It has to
end sometime...  No word about conversion items pending.

Egon

- Raw text -


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