π Get Next Line
About β’ Features β’ How it works β’ Author
π The goal of this project was to code a function that returns a line ending with a new line, read from a file descriptor.
Part | Functions |
---|---|
Mandatory Function | get_next_line |
Bonus Function | get_next_line_bonus |
Function | Behavior |
---|---|
get_next_line | The function takes an index of a file descriptor (fd ) along with a pointer to a string (line ), reads x bits (specified in BUFFER_SIZE ) from the file and returns 1 if there is a line break (\n), 0 if EOF (end of file) and -1 if there is an error |
get_next_line_utils_bonus | Same thing as get_next_line but in the bonus version it can get lines from more than one file |
git clone https://github.com/prmarquesz/get_next_line.git
It is necessary to define the BUFFER_SIZE or add the following flag to the compilation flags: -D BUFFER_SIZE=xx
gcc -D BUFFER_SIZE=32 main.c get_next_line.c get_next_line_utils.c
./a.out
Paulo Roberto Marques π
Made with β€οΈ by Paulo Roberto Marques ππ½ Get in Touch!