Path: utzoo!attcan!uunet!munnari.oz.au!uniwa!wacsvax!kim From: kim@wacsvax.cs.uwa.OZ.AU (Kim Shearer) Newsgroups: comp.std.c Subject: Re: Explain this sscanf behavior. Keywords: sscanf ANSI Message-ID: Date: 13 Jul 90 10:01:11 GMT References: <1990Jul6.181830.2549@tc.fluke.COM> <13168@shlump.nac.dec.com> Organization: Computer Science,The University of Western Australia. Lines: 25 In <13168@shlump.nac.dec.com> daniels@tle.enet.dec.com (Bradford R. Daniels) writes: >> compiler A: >> x=1 a=123 b=3 >> x=1 a=123 b=3 >This is the correct result. >> 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. +--------------------------------+--------------------------------------------+ Kim Shearer | ARPA: kim%wacsvax.uwa.oz@uunet.uu.net Dept. of Computer Science | UUCP: ..!uunet!munnari!wacsvax!kim University of Western Australia | ACSnet: kim@wacsvax.uwa.oz CRAWLEY, Australia 6009 | PHONE: +61 9 380 3452 +--------------------------------+--------------------------------------------+