Skip to content

Function that returns a line read from a file descriptor

Notifications You must be signed in to change notification settings

sshiling/42-GetNextLine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42 GetNextLine

Function that returns a line read from a file descriptor

GetNextLine is the third project in the study program at School 42 (UNIT Factory). Main goal of this project is to create function that will read any valid file, given as parameter, line by line till the end. “line” is a succession of characters that end with ’\n’ (ascii code 0x0a) or with End Of File (EOF). Each time function return readed line.

All functions are created in accordance with Norm - the bunch of rules how code should be formatted.

!NOTE
Because of 42 School norm requirements:

  • All variables are declared and aligned at the top of each function
  • Each function can't have more then 25 lines of code
  • C++ style code commenting is forbidden
  • Project should be created just with allowed functions otherwise it's cheating.

Of course you can read file lines, using standart C library, but in our case we needed to create our own function, using read, malloc, free and our libft library functions that we created earlier.

The project make student more confident with files manipulations, dynamic memory allocation and using pointers, arrays and linked lists. Also I get familiarized with static variables in this project.

This function and ft_printf(next project) were used in next projects a lot.

More about School 42 you can find here: https://en.wikipedia.org/wiki/42_(school)

About

Function that returns a line read from a file descriptor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published