/get_next_line

A function that reads a line until a newline is found, from the file descriptor (42 Project).

Primary LanguageC

(Screenshot)

get_next_line

The aim of this project is to create a function that reads a line until a newline is found, from the file descriptor.

This project also introduces the concept of static variables in C programming.

Technical considerations

  • Allowed functions: malloc, free, read
  • All heap allocated memory space must be properly freed when necessary
  • Using libft is not allowed for this project

How to test

Run the following commands

$ git clone https://github.com/rvan-duy/get_next_line.git
$ cd get_next_line
$ gcc -D BUFFER_SIZE=128 get_next_line.c get_next_line_utils.c
$ ./a.out

Example

(Screenshot)