This project involves creating a C function, get_next_line
, that reads lines from a file descriptor. The function should return each line one at a time upon repeated calls.
- 125%
- Efficiently reads lines from a file descriptor
- Uses static variables for improved performance
- Optional bonus part for handling multiple file descriptors
- Include the provided header file,
get_next_line.h
, in your C program. - Call the
get_next_line
function with the file descriptor you want to read from as an argument. - The function will return each line from the file one at a time until there are no more lines to read or an error occurs.
- Make sure to manage memory properly and handle errors as needed in your code.