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.