gets() function, the gnu c compiler gives a warning that it is dangerous to use gets()
hey buddy hope everyone might be getting this error while performing pratical-1 of pc.
here is detail description with solution..
gets() does not allow you limit the amount of input, which means it
can potentially overflow the buffer into which the input is placed.
Because it cannot be used safely. There is no length control. Two
possible replacements for it are fgets() (a C standard function)
and ggets() (a non-standard function). ggets is available in
source form, with no restrictions, as ggets.zip at:
<http://cbfalconer.home.att.net/download/>
That function is deprecated and will disappear shortly.
Its usage is not recommended because there is no way to
limit the input that it will receive, and it can overflow
the input buffer.
i used fgets and it works fine.
If you find this article helpful, Please like our Facebook page.
Enjoy GNU/Linux
Use FOSS
–tushar
hey…. thanksss..