Don't use Scanf()

Richard Harter g-rh at cca.CCA.COM
Sun Mar 20 04:08:44 AEST 1988


In article <296 at aiva.ed.ac.uk> richard at uk.ac.ed.aiva (Richard Tobin) writes:

>Of course, printf() vs write() is also a portability question, but I'm sure
>there will be plenty of comments on that...

Since you asked :-).  People who mix printf and write are likely to be
visited by things from Binkley's anxiety closet when they leave the safe
haven of UNIX.  If your software is going to run under any operating 
system other than UNIX, don't even think about doing this!

Paranthetically, it is good practice to gather all of your fopens, opens,
etc, together in a few well defined places in portable code.  Life will
be much simpler if you do.  [It may be best to use standardized macros
which are machine dependent, but I've never made the effort to do.  If
anyone has worked these out for VMS, UNIX, and PRIMOS and posts them, I
will bless them.]
-- 

In the fields of Hell where the grass grows high
Are the graves of dreams allowed to die.
	Richard Harter, SMDS  Inc.



More information about the Comp.lang.c mailing list