+ 2

why this error comes when I compile this gets() statement in C?

https://www.sololearn.com/post/357212/?ref=app

26th Apr 2020, 3:48 PM
Rahul Pandit
Rahul Pandit - avatar
2 odpowiedzi
+ 2
gets() function dangerous and shouldn'n be used.a safer alternative to gets() is fgets(), which reads up to a specified number of characters. This approach helps prevent a buffer overflow, which happens when the string array isn't big enough for the typed text for exemple :: fgets(buffer, 224, stdin); BigUp☆
26th Apr 2020, 6:06 PM
Amine Laaboudi
Amine Laaboudi - avatar