0 votes
in C Plus Plus by
Out of fgets() and gets() which function is safe to use and why in C Language?

1 Answer

0 votes
by
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 ().

Related questions

0 votes
asked Jan 12 in C Plus Plus by GeorgeBell
+1 vote
asked Jan 21, 2021 in C Plus Plus by SakshiSharma
...