This project was graded 125/100.
This project is all about writing down a useful set of functions to later on be used on future projects. All the code was implemented by me and based on the version of the subject available from the moment of the kickoff here in Porto, 2nd November 2022.
At 42, the C projects are built following a bunch of rules that enforce good coding style. Some of them are:
- No for, do while, switch, case or goto are allowed
- No more than 25 lines per function and 5 functions per file
- No assigns and declarations in the same line (unless static)
- No more than 5 variables in 1 function
...
Part / Total Functions | Function Name | Implemented |
---|---|---|
Mandatory (I) / 23 | ft_atoi | ✅ |
ft_bzero | ✅ | |
ft_calloc | ✅ | |
ft_isalnum | ✅ | |
ft_isalpha | ✅ | |
ft_isascii | ✅ | |
ft_isdigit | ✅ | |
ft_isprint | ✅ | |
ft_memchr | ✅ | |
ft_memcmp | ✅ | |
ft_memcpy | ✅ | |
ft_memmove | ✅ | |
ft_memset | ✅ | |
ft_strchr | ✅ | |
ft_strdup | ✅ | |
ft_strlcat | ✅ | |
ft_strlcpy | ✅ | |
ft_strlen | ✅ | |
ft_strncmp | ✅ | |
ft_strnstr | ✅ | |
ft_strrchr | ✅ | |
ft_tolower | ✅ | |
ft_toupper | ✅ | |
Mandatory (II) / 11 | ft_itoa | ✅ |
ft_putchar_fd | ✅ | |
ft_putendl_fd | ✅ | |
ft_putnbr_fd | ✅ | |
ft_putstr_fd | ✅ | |
ft_split | ✅ | |
ft_striteri | ✅ | |
ft_strjoin | ✅ | |
ft_strmapi | ✅ | |
ft_strtrim | ✅ | |
ft_substr | ✅ | |
Bonus Part / 9 | ft_lstadd_back | ✅ |
ft_lstadd_front | ✅ | |
ft_lstclear | ✅ | |
ft_lstdelone | ✅ | |
ft_lstiter | ✅ | |
ft_lstlast | ✅ | |
ft_lstmap | ✅ | |
ft_lstnew | ✅ | |
ft_lstsize | ✅ |
To compile the library you can either run make
or make bonus
in the terminal. The rule make
will only compile the mandatory part of this work, while the make bonus
rule will compile both the mandatory and the bonus part together.
Both rules generate a libft.a
file, which is zipped version of all the object files. Imagine you have a main.c
file and you want to use your library in it. You can compile it by running the following command:
$ cc -Wall -Wextra -Werror main.c -lft -L (REPLACE BY PATH TO libft.a) -I (REPLACE BY PATH TO libft.h)
This project was tested using the libft-unit-tester and manual revision only.
Feel free to ask me any questions through Slack (ncarvalh).