cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Why is gets() dangerous?
Why is gets() dangerous?
Jul 3, 2012 at 4:57pm UTC
johnwestman
(16)
Can somebody show by example how gets is dangerous?
Last edited on
Jul 3, 2012 at 5:45pm UTC
Jul 3, 2012 at 5:08pm UTC
Peter87
(11175)
gets is dangerous because it doesn't know the size of the char array. If the user enters more characters than can be stored in the char array gets will write out of bounds.
Jul 3, 2012 at 5:45pm UTC
johnwestman
(16)
Ok. Now I get it.
Topic archived. No new replies allowed.