This project is part of the 42 Prague curriculum.
The goal of libft is to reimplement a set of standard C library functions as well as additional utilities.
The result is a custom C library that can be reused in later 42 projects.
- Clone the repository:
git clone git@github.com:ylam21/libft.git libftcd libft- Compile the library:
makeThis will produce the libft.a static library.
make – Compile the library
make clean – Remove object files (.o)
make fclean – Remove object files and the compiled library (libft.a)
make re – Recompile everything (equivalent to fclean + make)
- Include the header in your source file:
#include "libft.h"- Compile your program with the library:
gcc -Ilibft your_program.c -Llibft -lft -o a.out-Ilibft tells the compiler where to find libft.h
-Llibft tells the linker where to find libft.a
-lft links the library
✅ Reimplemented libc functions
- isalpha
- isdigit
- isalnum
- isascii
- isprint
- strlen
- memset
- bzero
- memcpy
- memmove
- strlcpy
- strlcat
- toupper
- tolower
- strchr
- strrchr
- strncmp
- memchr
- memcmp
- strnstr
- atoi
- calloc
- strdup
- ft_substr
- ft_strjoin
- ft_strtrim
- ft_split
- ft_itoa
- ft_strmapi
- ft_striteri
- ft_putchar_fd
- ft_putstr_fd
- ft_putendl_fd
- ft_putnbr_fd
🏗️ Bonus part – Linked list functions
- ft_lstnew
- ft_lstadd_front
- ft_lstsize
- ft_lstlast
- ft_lstadd_back
- ft_lstdelone
- ft_lstclear
- ft_lstiter
- ft_lstmap
This library will be used as a foundation for future 42 projects.
Functions follow the 42 norminette coding standard.
Each function is prefixed with ft_ to avoid naming conflicts with the standard library.