Talking about scanf (was Re: What's so bad about scanf anyway???)

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Fri Nov 23 16:56:37 AEST 1990


In article <17295 at netcom.UUCP>, avery at netcom.UUCP (Avery Colter) writes:
> Another thing in scanf's favor over gets...

> While reading the new and improved 10 commandments, I was reminded of
> gets' nasty habit of taking any size line given to it.

Why is this a point in favour of scanf()?
	scanf("%[^\n]%*c", buff) >= 0
and
	gets(buff) != NULL
do pretty much the same thing; scanf() will "take any size line given to it".

-- 
I am not now and never have been a member of Mensa.		-- Ariadne.



More information about the Comp.lang.c mailing list