Out of fgets() and gets() which function is safe to use and why?

C Programming Language >   Function in C Language >   About Java Tutorial  

Long Question

1846


Answer:

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 ().


This Particular section is dedicated to Question & Answer only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.