cin.getline() and gets()

Mar 28, 2009 at 8:18am
What is difference between cin.getline() and gets() wrt their functionality??
Mar 28, 2009 at 9:32am
Mar 28, 2009 at 4:33pm
Don't use gets(). :-)
Mar 28, 2009 at 4:46pm
Whats wrong with gets()?
Mar 28, 2009 at 5:15pm
It's C. When possible is better using C++ features
Mar 28, 2009 at 5:20pm
Seems simple enough, I thought it might have been something like unpredictable output or the likes.
Mar 28, 2009 at 8:16pm
It's worse than that. gets() is evil.
http://www.gidnetwork.com/b-56.html
:-)
Mar 29, 2009 at 8:16pm
Thank you for that information, it was a sound argument. gets() should never be used.
Mar 31, 2009 at 9:46am
Thanks for that. Actually, our instructor uses gets() frequently for all string inputs. Now I know that it's bad, though. Thanks again!!
Mar 31, 2009 at 8:57pm
I would suggest a refresher course for your instructor. ;)
Last edited on Mar 31, 2009 at 8:58pm
Apr 1, 2009 at 1:00am
Dear teacher is teacher
If u think that gets() should not use than u must argue with ur instructor infovour of urself and if ur instructor will be right then He/She will tell u its benefit to use or drawback etc.

By the way i myself never use gets().
thanks
Topic archived. No new replies allowed.