Libft is the first mandatory project of 42 School. The goal is to create your own C Standard Library, replicate several libc functions, and implement extra utility functions that you will later reuse in other projects.
This version includes:
- All mandatory functions
- All bonus linked list functions
✨ Mandatory Functions
- Character checks (isalnum, isalpha, etc.)
- Memory manipulation (memcpy, memset, calloc…)
- String manipulation (strlen, strjoin, strtrim…)
- Conversion utilities (atoi, itoa)
- Output helpers (putchar_fd, putstr_fd…)
🧠 Bonus: Linked Lists 🪴
All list utilities using the t_list structure:
-
ft_lstnew_bonus.c
-
ft_lstadd_front_bonus.c
-
ft_lstsize_bonus.c
-
ft_lstlast_bonus.c
-
ft_lstadd_back_bonus.c
-
ft_lstdelone_bonus.c
-
ft_lstclear_bonus.c
-
ft_lstiter_bonus.c
-
ft_lstmap_bonus.c
These help you build and manipulate singly linked lists easily.
⚙️ Usage
📚 Compile the library
make
This will generate:
libft.a
Clean object files
make clean
Clean + remove library
make fclean
Rebuild everything
make re
🧪 Example
main.c
#include "libft.h"
#include <stdio.h>
int main(void)
{
printf("%d\n", ft_isalpha('a'));
printf("%zu\n", ft_strlen("Hello libft!"));
return 0;
}
Compile:
cc main.c libft.a
💡 Why Libft is important
-Understand core C functions internally
-Learn memory management (stack/heap)
-Learn static libraries
-Improve code design & API structure
-Reuse functions in future projects: get_next_line, push_swap, minishell, fract-ol
👨💻 Author
Emanuel Tchipoque
🔗 LinkedIn: Emanuel Tchipoque