Skip to content

Contents of 42sp's Second Project - Create a Function That Reads a File Line by Line

Notifications You must be signed in to change notification settings

ArthurSobreira/42_get_next_line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Get Next Line [125 / 100]

Summary

The second project on the 42sp fundamentals track, Get Next Line, is based on the creation of a function that returns line by line from a file pointed to by a file descriptor, covering topics such as reading and describing files, static variables, dynamic allocation memory, pointers, and more.


Project Files


Run the Program

  • Make sure you clone the repository with the following command:
$> git clone [email protected]:ArthurSobreira/42_get_next_line.git
  • Once cloned, compile the program with the following command (the value of BUFFER_SIZE can be changed if you prefer):
$> cc -Wall -Wextra -Werror -D BUFFER_SIZE=42 main.c src/get_next_line.c utils/get_next_line_utils.c include/get_next_line.h && ./a.out
  • Running the binary, the result should look something like this:
Line 1 -> ██╗░░██╗███████╗██╗░░░░░██╗░░░░░░█████╗░  ░██╗░░░░░░░██╗░█████╗░██████╗░██╗░░░░░██████╗░
Line 2 -> ██║░░██║██╔════╝██║░░░░░██║░░░░░██╔══██╗  ░██║░░██╗░░██║██╔══██╗██╔══██╗██║░░░░░██╔══██╗
Line 3 -> ███████║█████╗░░██║░░░░░██║░░░░░██║░░██║  ░╚██╗████╗██╔╝██║░░██║██████╔╝██║░░░░░██║░░██║
Line 4 -> ██╔══██║██╔══╝░░██║░░░░░██║░░░░░██║░░██║  ░░████╔═████║░██║░░██║██╔══██╗██║░░░░░██║░░██║
Line 5 -> ██║░░██║███████╗███████╗███████╗╚█████╔╝  ░░╚██╔╝░╚██╔╝░╚█████╔╝██║░░██║███████╗██████╔╝
Line 6 -> ╚═╝░░╚═╝╚══════╝╚══════╝╚══════╝░╚════╝░  ░░░╚═╝░░░╚═╝░░░╚════╝░╚═╝░░╚═╝╚══════╝╚═════╝░

About

Contents of 42sp's Second Project - Create a Function That Reads a File Line by Line

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages