get_next_line() is a C function that reads the next line from a file and returns it. This project was developed as part of the Common Core curriculum at 42 São Paulo.
- What is a FD in Unix systems
- File manipulation in C
- How to use static variables
Clone the repository and compile the files with your preferred C compiler, such as clang or gcc.
Note: the project is separated into two parts, the mandatory and the bonus. If you want to compile the project with the bonus, only the files with "_bonus" at the end of the name should be compiled.
The project is divided into two parts, the mandatory and the bonus, which includes the entire original project and more resources.
get_next_line.c
includes thechar *get_next_line(int fd)
function and all the main logic of the project itselfget_next_line_utils.c
includes utility functions, which are part of Libft or were adapted from functions in that libraryget_next_line.h
is the project header file
All bonus files have "_bonus" at the end of their names. To run the project with the bonus, simply compile these files, as they also include the mandatory logic.
The bonus has two requirements:
- Develop the function using only one static variable
- The function must be able to handle multiple file descriptors at the same time