Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.std.c Subject: Re: scanf question Message-ID: <9697@smoke.BRL.MIL> Date: 23 Feb 89 14:20:46 GMT References: <9676@cit-vax.Caltech.Edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <9676@cit-vax.Caltech.Edu> johns@tybalt.caltech.edu.UUCP (John Salmon) writes: >"...A white-space directive fails if no white-space can be found." >K&R 2nd edition says that "white-space directives are ignored" >Which is correct? Neither. A white-space directive is executed by reading input up to the first non-white-space character (which remains unread), or until no more characters can be read. It never fails, by definition. > Is count set to 0 or 1 by: > count = sscanf("10", " %d", &i); sscanf returns 1 in this case.