In defense of scanf() (Re: Re^2: scanf(..))

Ed Nather nather at ut-emx.UUCP
Sat Aug 5 01:40:27 AEST 1989


In article <1122 at midgard.Midgard.MN.ORG>, dal at midgard.Midgard.MN.ORG (Dale Schumacher) writes:
> The operation of strtok() described above is NOT broken, it's documented.
> It is also somewhat less useful than it could be due to its "interesting"
> quirks, but it IS defined as working that way.

Gosh, that makes programming really easy!  Just throw something together,
document all the bugs, and you're done!

In my view, the operation of strtok() --- and, to a considerable extent, the
operation of scanf() --- are both broken, documentation notwithstanding.  I
have totally avoided scanf() for 8 years, and will continue to do so.  I
wrote my own small versions of strtok() after reading its description, so I 
have never used the "official" one.

-- 
Ed Nather
Astronomy Dept, U of Texas @ Austin



More information about the Comp.lang.c mailing list