hey wat is d use of gets( ) function in C..?:?:

Votes + Comments
This isn't a chat room. Learn to spell your words properly.
8 Years
Discussion Span
Last Post by Dave Sinkula

Right from my linux/GNU man file

Never use gets(). Because it is impossible to tell without knowing the data in advance
how many characters gets() will read, and because gets() will continue to store characā€
ters past the end of the buffer, it is extremely dangerous to use. It has been used to
break computer security. Use fgets() instead.

Votes + Comments
Indeed, it is so.

i askd wat is d use of gets() function.......

Votes + Comments
Do you really think you're so important? Use Google and figure it out yourself the next time.

hey wat is d use of gets( ) function in C..?:?:

  • It's an unsafe function that should never be used.
  • When found in code, its presence prompts more experienced programmers (those with more than say, 1 day of C programming under their belts) to pound on the pathetic, poor, foolish rookie who put it in his code.
  • The function generally prompts the posting of copious links telling you never to use the function.
  • It is a function that if used in code indicates to others that the programmer has absolutely no idea how to program in the C language.


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.