delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/09/03/01:30:13

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Trace-PostClient-IP: 68.147.131.211
From: Brian Inglis <Brian DOT Inglis AT SystematicSW DOT Invalid>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: scanf: strange behavior?
Organization: Systematic Software
Message-ID: <iqvfj01jbhglsr1p89ddfv5u3b4980pbcl@4ax.com>
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> <20040902221157 DOT GB7970 AT webhome DOT cz> <200409022230 DOT i82MUuqE006471 AT envy DOT delorie DOT com> <9ccfj0hufuh2nii5jfjqlqgbf3g7b34mo6 AT 4ax DOT com> <200409030035 DOT i830ZmMC008458 AT envy DOT delorie DOT com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Lines: 28
Date: Fri, 03 Sep 2004 05:23:17 GMT
NNTP-Posting-Host: 24.71.223.147
X-Complaints-To: abuse AT shaw DOT ca
X-Trace: pd7tw2no 1094188997 24.71.223.147 (Thu, 02 Sep 2004 23:23:17 MDT)
NNTP-Posting-Date: Thu, 02 Sep 2004 23:23:17 MDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Thu, 2 Sep 2004 20:35:48 -0400 in comp.os.msdos.djgpp, DJ Delorie
<dj AT delorie DOT com> wrote:

>
>> "7.19.6.2#16 The fscanf function
>
>It's sscanf that's the interesting one.

Not too different, except string nul terminator is treated the same as
an input file EOF:

"7.19.6.7#2 The sscanf function is equivalent to fscanf, except that
input is obtained from a string (specified by the argument s) rather
than from a stream. Reaching the end of the string is equivalent to
encountering end-of-file for the fscanf function. If copying
takes place between objects that overlap, the behavior is undefined.
Returns
3 The sscanf function returns the value of the macro EOF if an input
failure occurs before any conversion. Otherwise, the sscanf function
returns the number of input items assigned, which can be fewer than
provided for, or even zero, in the event of an early matching
failure."

-- 
Thanks. Take care, Brian Inglis 	Calgary, Alberta, Canada

Brian DOT Inglis AT CSi DOT com 	(Brian[dot]Inglis{at}SystematicSW[dot]ab[dot]ca)
    fake address		use address above to reply

- Raw text -


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