get_next_line

get_next_line is a project at 42.

Detail

It is a function that reads a file and allows you to read a line ending with a newline character from a file descriptor. When you call the function again on the same file, it grabs the next line. This project deals with memory allocation and free allocated memory to prevent leaks.

Return Value

'-1' is returned if an error occurred. '0' is returned if the file is finished reading. '1' is returned if a line is read.