Skip to content

Matesant/Get_next_line

Repository files navigation

Push swap

Imagem 1 Imagem 2

Making your own C library

The objective of this project is to create a function in the C language that, when called, returns a line.

About

As the second project in École 42's common core, this assignment focuses on better understanding malloc, free, open, and read. The goal is to implement get_next_line, a function that reads a text until it encounters a newline (\n) and returns the extracted line.

Requirements

The functions are written in C language and need the gcc compiler.

Instructions

1. Compiling the archives

To compile the project, go to its path and run:

For mandatory :

gcc -Wall -Werror -Wextra -D BUFFER_SIZE=10 get_next_line.c get_next_line_utils.c -o get_next_line main.c

Bonus

Support multiple File Descriptors

To compile the bonus:

For bonus :

gcc -Wall -Werror -Wextra -D BUFFER_SIZE=10 get_next_line_bonus.c get_next_line_utils_bonus.c -o get_next_line_bonus main.c

Explanation

  • Wall -Werror -Wextra: Enable all warnings and treat them as errors.
  • D BUFFER_SIZE=xx: Define the BUFFER_SIZE macro (replace xx with the desired buffer size).
  • o get_next_line: Name the output file get_next_line.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages