“Libft – your own first library” is an individual project at 42, it is the second one i have worked on after the “Piscine Reloaded one”.
The aim of this project is to code a C library regrouping usual functions that we’ll be allowed to use in all our other projects. At 42 we are not allowed to use standard C library function, we can use only function we coded ourself. So the longer term goal of this library is to grow with our own function.
For this library there are only 3 standard library function allowed are write() from <unistd.h>, malloc() and free() from <stdlib.h>. We are allowed also to use <string.h> for accessing size_t and NULL.
Here is the link to the GitHub repository: https://github.com/nmanzini/libft-42
LIBFT is the second project we worked on after starting the school. This project required a lot of checking for all the possible cases in which a standard function can fail or not. This library has been thoroughly checked.
|Lib C Functions||42 Functions||List Functions|
There are 3 kinds of function:
- Lib C Functions: are the function coming from standard C libraries have a “ft_” before them to avoid conflict with the original ones.
- 42 Functions: Functions used at Ecole 42, mainly memory and string manipulation
- List Functions: Used for list creation and manipulation.
Recreating all these function is a great exercise to understand what these function do in detail, their limitation and unexpected results. Unit testing them is a even greater challenge than writing them.
At 42 we don’t have to study what a function does, when you are stuck for hours recoding them you are forced to understand them deeply.