What does gets() function do ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What does gets() function do ?

9th Mar 2017, 8:12 AM
Canterville Ghost
Canterville Ghost - avatar
3 Answers
+ 13
gets() is a function used to get a line of input into a string variable. The function has already been deprecated, though.
9th Mar 2017, 8:24 AM
Hatsy Rei
Hatsy Rei - avatar
+ 2
like Hatsy said it is depracated and is unsafe to use, u can get an overflow with it. Consider using fgets instead, you can give the size of the input as parameter to the function to prevent overflow.
9th Mar 2017, 8:52 AM
EagleEye
EagleEye - avatar
+ 1
ok , thanx guys
9th Mar 2017, 8:52 AM
Canterville Ghost
Canterville Ghost - avatar