2D array of structures

C

CBFalconer

svata said:
Richard Heathfield wrote:
.... snip ...


Can you explain me why should I refrain from using scanf()? Is that
function cursed or what? I see real difference in using gets() of
fgets(). But Borland C compiler gives no warning about using gets...

In reverse order, no warning is required for gets avoidance, just
common sense, because it cannot be used safely. You can use my
ggets instead (see url below).

Yes, scanf is cursed, especially for interactive use. The only
sane way to use it is for one item at a time, carefully checking
its return value. Unless your name is Dan Pop.
 
N

Norbert Kolvenbach

Richard said:
svata said:



No, but it's very easy to misuse it. Most teachers teach it badly. Yours
does, for example.

Very much agreed. So why not write a book about it (or at least a chapter)?
Your writing is good reading.

Long time ago I used (f)scanf extensively and it's appropriate if you know
what you do.


NoKo
 
R

Richard Heathfield

Norbert Kolvenbach said:
Richard said:
No, but it's very easy to misuse [scanf]. Most teachers teach it badly.
[...]

Very much agreed. So why not write a book about it (or at least a
chapter)?

Oh, please don't ask me to do that! :)

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
 
S

svata

Richard said:
Oh, please don't ask me to do that! :)

But then novices like me will ask same questions again and again. I
admit, scanf is a bit tricky and can cause headache if used improperly.

svata
 
R

Richard Heathfield

svata said:
But then novices like me will ask same questions again and again.

Point taken. Added to my "to-do" list. Near the bottom somewhere, though.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: normal service will be restored as soon as possible. Please do not
adjust your email clients.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top