in C Plus Plus by
Q:
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 ().
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

0 votes
asked Mar 17, 2020 in C Plus Plus by SakshiSharma
+2 votes
asked Jan 21 in C Plus Plus by SakshiSharma
0 votes
asked Dec 4, 2020 in Amazon Elastic Compute Cloud EC2 by sharadyadav1986
0 votes
asked Jun 11, 2020 in C Plus Plus by Robindeniel
0 votes
asked Mar 10, 2020 in C Plus Plus by rahuljain1
...