+ 10

Is "gets " function danger😯,if yes why?

in a recent compilation, I got to know that I have used "gets()" for a string input .in recent output it says that it is dangerous to use gets function. I don't know the reason. https://code.sololearn.com/czMHY9I2cA58/?ref=app

3rd Nov 2019, 5:28 AM
Charan Leo25
Charan Leo25 - avatar
8 ответов
+ 5
gets is indeed insecure. It does not perform bounds checking so it can easily cause buffer overflows: https://code.sololearn.com/cZ4tej81iDYE/?ref=app https://code.sololearn.com/c0Y73PhmZ5Hd/?ref=app
3rd Nov 2019, 6:54 AM
Aaron Eberhardt
Aaron Eberhardt - avatar
+ 7
HAR$HIT $HARMA i created post by pc so there was no option . Now i have linked
3rd Nov 2019, 5:51 AM
Charan Leo25
Charan Leo25 - avatar
+ 3
Just keep on practice and code Victor Jumbo
13th Nov 2019, 1:01 AM
Charan Leo25
Charan Leo25 - avatar
+ 2
Charan LEo25 please remove 25 and C# from tags and add tags like gets, input Or is it really related to 25 and c#?
3rd Nov 2019, 5:38 AM
🇮🇳Omkar🕉
🇮🇳Omkar🕉 - avatar
+ 2
Sombre just btw. gets has been officially deprecated since 1999 and was even removed in later C++ standards. There are better and more secure alternatives, gets literally just exists for backwards comparability with old C code.
5th Nov 2019, 6:46 AM
Aaron Eberhardt
Aaron Eberhardt - avatar
+ 1
You should post the code!!!
3rd Nov 2019, 5:47 AM
Harshit Sharma
Harshit Sharma - avatar
0
I find it difficult to understand functions and classes, I'm new here.
11th Nov 2019, 11:39 PM
Jumbo Victor
Jumbo Victor - avatar