What's so bad about scanf anyway???

Avery Colter avery at netcom.UUCP
Sun Nov 11 09:25:41 AEST 1990


In the self-teaching course I have here, scanf is the most often used
input function. I don't see gets used much at all.

And indeed, gets only seems of much advantage when you want to take in
a whole line into one string.

Otherwise, scanf can take individual numbers and put them directly into
numerical variables. With gets, you'd have to first manually parse the
line, and then use strtol to translate them into numbers.

I didn't see puts used for printing strings to screen much either.
printf was the function of choice.

-- 
Avery Ray Colter    {apple|claris}!netcom!avery  {decwrl|mips|sgi}!btr!elfcat
(415) 839-4567   "Fat and steel: two mortal enemies locked in deadly combat."
                                     - "The Bending of the Bars", A. R. Colter



More information about the Comp.lang.c mailing list