On Sun, 19 Jun 2005 02:08:52 +0200, Jean-Claude Arbaut
<jean-> wrote in comp.lang.c:
>
> Le 19/06/2005 00:54, dans nospam-,
> «*Lefty Bigfoot*» <> a écrit*:
>
> >
> > Hello,
> >
> > I am aware that a lot of people are wary of using scanf,
> > because doing it improperly can be dangerous. I have
> > tried to find a good tutorial on all the ins and outs
> > of scanf() but been unsuccessful.
> >
> > Is there a well-respected (by the c.l.c crowd) book
> > or tutorial that really covers scanf in detail?
>
> Yes, the ISO 9899-1999 Standard, section 7.19.6.4.
> I can swear it's well respected here
That's actually not a reference to how to use the function safely, nor
even a recommendation that it should be used.
See 7.19.7.7, which describes the gets() function, and includes not so
much as a hint of a warning about buffer overflows.
> There is also the POSIX standard, at
> http://www.opengroup.org/onlinepubs/000095399/
> certainly well respected too.
>
> If you want a tutorial, maybe the K&R C book will help you.
>
> If you have UNIX or Linux, try "man scanf"
The general consensus here, which I agree with, is that the *scanf()
functions are best avoided by all except extreme experts on their use.
If non-experts avoid them, the will never become extreme experts,
making the point moot.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html