The gets function reads input characters without conversion until an end of line is read or end of file is detected.
Characters are stored in the character array provided.
The newline character is not stored. Instead a null byte (all bits 0) is stored in its place.
In either case, a null byte is stored to indicate the end of the characters and allow the array of char's to be treated as a single string.
The gets function does not have any way of checking that the array is big enough to hold the input! It just keeps reading and storing until end of line or end of file is detected.