Login
Remember
Register
Ask a Question
Out of fgets() and gets() which function is safe to use and why in C Language?
0
votes
asked
Mar 10, 2020
in
C Plus Plus
by
rahuljain1
Out of fgets() and gets() which function is safe to use and why in C Language?
#c-language-fgets
#c-language-gets
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Mar 10, 2020
by
SakshiSharma
fgets() is safer than gets(), because we can specify a maximum input length. Neither one is
completely safe, because the compiler can‘t prove that programmer won‘t overflow the buffer he
pass to fgets ().
...