Skip to main content

Why does some code use gets()?

Created
Active
Viewed 17 times
1 replies
1

Sometimes I see (often beginner) code that uses gets(), a function you should never use for any reason. The function was so bad that it is was even removed from the C Standard at some point.

But as for beginner code, why would their instructors be teaching them that using gets() was a good idea? And as for non-beginner code, why would any programmer have used it in the first place?

If gets() is so bad, why was it ever used at any point?

  • 4.4k
  • 35
  • 25
  • 47

1 reply

Sorted by: