3
Contributors
2
Replies
16
Views
2 Years
Discussion Span
Last Post by L7Sqr
1

No, you don't. You want to stay away from gets() entirely, in fact. The function is extremely dangerous, because it is prone to buffer overruns, and no experienced C/C++ programmer still uses it.

2

Well, knowing how it works and using it are entirely different.

I agree with Schol-R-LEA in that you should never use this function. However, if you want to learn how it works internally to better understand it and why you should avoid it - that is a good thing.

Look for an open source implementation of it (FreeBSD, for example: gets.c)

Edited by L7Sqr

This question has already been answered. 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.