 | | The gets function reads characters from stdin and places them into s until either a newline character is read or end-of-file is encountered. The fgets function reads characters from stream and places them into s until either a newline character is encountered, n-1 characters have been read, or end-of-file is encountered. Both functions terminate s with a null character and return s, or return the constant NULL if end-of-file is encountered before any characters have been read. For historical reasons, gets discards the newline character, while fgets copies it into s. | |
|