Skip to content

get_next_line() is a C function that reads the next line from a file and returns it. This project was developed as part of the Common Core curriculum at 42 São Paulo.

Notifications You must be signed in to change notification settings

LuizGandra/get-next-line-42

Repository files navigation

Get Next Line

get_next_line() is a C function that reads the next line from a file and returns it. This project was developed as part of the Common Core curriculum at 42 São Paulo.

What You Will Learn

  • What is a FD in Unix systems
  • File manipulation in C
  • How to use static variables

How to Test

Clone the repository and compile the files with your preferred C compiler, such as clang or gcc.

Note: the project is separated into two parts, the mandatory and the bonus. If you want to compile the project with the bonus, only the files with "_bonus" at the end of the name should be compiled.

Project Structure

The project is divided into two parts, the mandatory and the bonus, which includes the entire original project and more resources.

Files

  • get_next_line.c includes the char *get_next_line(int fd) function and all the main logic of the project itself
  • get_next_line_utils.c includes utility functions, which are part of Libft or were adapted from functions in that library
  • get_next_line.h is the project header file

Bonus

All bonus files have "_bonus" at the end of their names. To run the project with the bonus, simply compile these files, as they also include the mandatory logic.

The bonus has two requirements:

  • Develop the function using only one static variable
  • The function must be able to handle multiple file descriptors at the same time

About

get_next_line() is a C function that reads the next line from a file and returns it. This project was developed as part of the Common Core curriculum at 42 São Paulo.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages