/get_next_line

A function which returns a line read from a file descriptor, without the newline.

Primary LanguageC

My newest project as a cadet at Γ‰cole 42. This is my get next line function.

Status: Finished βœ…πŸš€

About β€’ Features β€’ How it works β€’ Author

πŸ’» About

πŸ“‘ The goal of this project was to code a function that returns a line ending with a new line, read from a file descriptor.

🎯 Briefing

Part Functions
Mandatory Function get_next_line
Bonus Function get_next_line_bonus

βš™ Features

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

πŸš€ How it works

Clone this repository

git clone https://github.com/prmarquesz/get_next_line.git

Compilation

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

Running the program

./a.out

πŸ‘¨β€πŸš€ Author


Paulo Roberto Marques
πŸš€

Made with ❀️ by Paulo Roberto Marques πŸ‘‹πŸ½ Get in Touch!

Linkedin Badge Instagram Badge