A project made in accordance with the get_next_line project which is part of the Codam Core Curriculum. The goal is to write a function get_next_line(), which takes a file descriptor as an argument and reads the corresponding file one line at a time. The function returns the line read.
Start by cloning the repository:
https://github.com/fkoolhoven/get_next_line.git
To use the function in your code, simply include the header:
#include "get_next_line.h"
and add the .c files when you're compiling. Lastly, define a buffer size. For example:
gcc main.c get_next_line.c get_next_line_utils.c -D BUFFER_SIZE=10
- Learned to use static variables.
- Became familiar with opening and reading files in C.
- Deepened my knowledge of memory allocation and preventing/eliminating leaks.
See my profile page for ways to contact me!