Re: Q=D0=B0=DD=A6p=A6=F3=A5=CEc=BBy=A8=A5=BCg=A4=40=B5=7B=A6=A1?=

From: CBFalconer (cbfalconer_at_yahoo.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 16:45:33 GMT

Malcolm wrote:
> "Martin Ambuhl" <mambuhl@earthlink.net> wrote in message
>>
>> if (2 != (nread = sscanf(input, "%d%d", &first, &second))) {
>>
> This line has many unspeakable style sins.

On the contrary, it is a proper detection of correct operation of
the sscanf call, preserving the results for possible diagnostics,
and allowing continuation (in an else clause) whith the knowledge
of success.

-- 
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!


Relevant Pages