Reading a line from a fd is way too tedious
This project is about programming 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 make you learn a highly interesting new concept in C programming: static variables.
You will understand how files are opened, read and closed in an OS,
and how they are interpreted by a programming language for further analysis.
This task is crucial to understand for a future programmer since much of the time is based
on manipulating files for data management and persistence.
This project consists of coding a function that returns one line at a time from a text file.
For more detailed information, look at the subject of this project.
The function is written in C language and thus needs the C compiler and some standard C libraries to run.
- Pull files
โ๏ธ
$ git clone https://github.com/juwkim/get_next_line
- To compile
โ๏ธ
cc -Wall -Werror -Wextra -D BUFFER_SIZE=<size> get_next_line.c get_next_line_utils.c "main.c"
- To use get_next_line in your code
โ๏ธ
#include "get_next_line.h"