/Get_next_line

My work on the 42 get_next_line project.

Primary LanguageC

Get_next_line

My work on the 42 get_next_line project (here without the bonus part).

The aim of this project is to make you code a function that returns a line, read from a file descriptor.

This project will not only allow you to add a very convenient function to your collection, but it will also allow you to learn a highly interesting new concept in C programming: static variables.

Function Prototype

char	*get_next_line(int fd);

Return value

Value Description
Read line correct behavior
NULL nothing else to read or an error has occured

Functions Used

External Functions

Function Description
read() A line has been read
malloc() EOF has been reached
free() An error happened

Notes

I wrote this code to be as easy to understand as possible because it was coded for a video tutorial, which explains why I left some comments inside the main function.

Bonus

I made two videos about this project!

understanding get_next_line


coder get_next_line
(understanding get_next_line)

english subtitles

coding get_next_line


coder get_next_line
(coding get_next_line)

subtitles to come