🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5735

Re: scanf question

#5735
From: Doug Gwyn
Date: Thu, 23 Feb 1989 14:20
13 lines
955 bytes
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.
Technical Details
Message-ID: <9697@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn
References: <9676@cit-vax.Caltech.Edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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) <gwyn>)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 13