Path: utzoo!attcan!uunet!aplcen!haven!decuac!shlump.nac.dec.com!tle.enet.dec.com!daniels From: daniels@tle.enet.dec.com (Bradford R. Daniels) Newsgroups: comp.std.c Subject: Re: Explain this sscanf behavior. Keywords: sscanf ANSI Message-ID: <13414@shlump.nac.dec.com> Date: 13 Jul 90 15:45:07 GMT References: <1990Jul6.181830.2549@tc.fluke.COM> <13168@shlump.nac.dec.com> Sender: newsdaemon@shlump.nac.dec.com Reply-To: daniels@tle.enet.dec.com (Bradford R. Daniels) Organization: Digital Equipment Corporation Lines: 22 > >> compiler B: > >> x=1 a=123 b=3 > >> x=1 a=123 b=4 <-- yes 4. > > >This is clearly wrong, since there aren't even 4 characters in the string... > > Why, the value of b is clearly invalid as only one > argument was comsumed. Nothing was read into b so > how can you say it was incorrectly assigned. Pardon? I have to disagree with you here. Clearly, an assignment was made, otherwise the value of b would be -99. The return value of 1 tells us nothing, since the standard explicitly states that the count of converted arguments does not get incremented by %n. - Brad ----------------------------------------------------------------- Brad Daniels | Digital Equipment Corp. almost DEC Software Devo | definitely wouldn't approve of "VAX C RTL Whipping Boy" | anything I say here...