About • How to use • Mandatory • Bonus • Norminette • License
The first project at 42, libft, involves learning how the standard functions of C programming work by writing them from scratch and creating a personal library. This project is vital as the library will be used in future assignments at 42.
If you're a 42 student, it's highly recommended that you go through the process of writing your own code and testing it yourself rather than copying and pasting code that you only partially understand. If you've successfully completed your piscine, there's no reason why you couldn't tackle this project on your own! Be patient and thorough.
Click here for the subject of this project.
git clone git@github.com:MarouanDoulahiane/libft.git
cd libft/libft
make
#include "libft.h"
make
- Compile libft mandatory files.
make bonus
- Compile libft bonus files.
make all
- Compile mandatory + bonus files.
make clean
- Delete all .o (object files) files.
make fclean
- Delete all .o (object file) and .a (executable) files.
make re
- Use rules fclean
+ all
.
The mandatory functions in libft include both functions from the standard C library and other functions that are useful for character, string, and memory manipulation. These 34 mandatory functions are essential to achieving a grade of 100.
-
ft_isalpha
-
ft_isdigit
-
ft_isalnum
-
ft_isascii
-
ft_toupper
-
ft_tolower
-
ft_strlen
-
ft_strlcpy
-
ft_strlcat
-
ft_strchr
-
ft_strrchr
-
ft_strncmp
-
ft_strnstr
-
ft_substr
-
ft_strjoin
-
ft_strtrim
-
ft_split
-
ft_strmapi
-
ft_striteri
-
ft_calloc
-
ft_memset
-
ft_bzero
-
ft_memcpy
-
ft_memmove
-
ft_memchr
-
ft_memcmp
-
ft_strdup
-
ft_atoi
-
ft_itoa
-
ft_putchar_fd
-
ft_putstr_fd
-
ft_putendl_fd
-
ft_putnbr_fd
The bonus functions in libft are focused on list manipulation and are worth an additional 25 towards the final grade. To achieve a grade of 125, all 9 bonus functions and 34 mandatory functions must be completed accurately.
-
ft_lstnew
-
ft_lstadd_front
-
ft_lstsize
-
ft_lstlast
-
ft_lstadd_back
-
ft_lstdelone
-
ft_lstclear
-
ft_lstiter
-
ft_lstmap
At 42 School, it is expected that almost every project is written in accordance with the Norm, which is the coding standard of the school.
- No for, do...while, switch, case, goto, ternary operators and variable-length arrays are allowed
- Each function must be a maximum of 25 lines, not counting the function's curly brackets
- Each line must be at most 80 columns wide, comments included
- A function can take 4 named parameters maximum
- No assigns and declarations in the same line (unless static)
- You can't declare more than 5 variables per function
- ...
- 42 Norms - Information about 42 code norms.
PDF
- Norminette - Tool by 42, to respect the code norm.
GitHub
- 42 Header - 42 header for Vim.
GitHub
This work is published under the terms of MIT LICENSE.