Out of fgets() and gets() which function is safe to use and why?

Showing Answers 1 - 2 of 2 Answers

Ajay K

  • Jul 1st, 2007
 

gets does NOT check the size of the buffer and overflow on the stack can occour. Because of this, you should use fgets in preferance.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions