Hello,
Out of fgets() and gets() which function is safe to use and why?
Thanks
It depends where you are using :
fgets reads characters from stream into the string s. It stops when it reads either n - 1 characters or a newline character, whichever comes first.
gets collects a string of characters terminated by a new line from the
standard input stream stdin and puts it into s.
Reputation Points: 6
Solved Threads: 9
Junior Poster in Training
Offline 90 posts
since Nov 2008