Out of fgets() and gets() which function is safe to use and why?- The fgets() function is safer to use.
- It checks the bounds, i.e., the size of the buffer and does not cause overflow on the stack to occur.
- The gets() function does not check the bounds.
- The gets() function is an insecure and careless use can lead to errors.
|