A custom C standard library implementation built from scratch as part of the 42 curriculum.
Libft is a personal recreation of several standard C library functions, along with additional utility functions and a linked list implementation.
The goal is to understand how these core functions work internally by reimplementing them from scratch without using the original libc implementations.
This library includes:
Rewritten versions of common C functions:
- Character checks:
ft_isalpha,ft_isdigit,ft_isalnum,ft_isascii,ft_isprint - String manipulation:
ft_strlen,ft_strlcpy,ft_strlcat,ft_strdup,ft_strchr,ft_strrchr,ft_strncmp,ft_strnstr - Memory functions:
ft_memset,ft_bzero,ft_memcpy,ft_memmove,ft_memchr,ft_memcmp - Conversion:
ft_atoi,ft_itoa - Case conversion:
ft_toupper,ft_tolower - Allocation:
ft_calloc
Helpful additional functions:
-
ft_substr -
ft_strjoin -
ft_strtrim -
ft_split -
ft_strmapi -
ft_striteri -
File descriptors helpers:
ft_putchar_fdft_putstr_fdft_putendl_fdft_putnbr_fd
A simple linked list implementation:
ft_lstnewft_lstadd_frontft_lstadd_backft_lstsizeft_lstlastft_lstdeloneft_lstclearft_lstiterft_lstmap
Compile the library using:
makeThis generates:
libft.aTo remove object files:
make cleanTo remove everything:
make fcleanTo rebuild:
make reInclude the header in your project:
#include "libft.h"Compile your program with the library:
gcc main.c -L. -lftlibft/
βββ srcs/
βββ obj/
βββ libft.h
βββ Makefile
βββ libft.a
This project is part of the 42 School curriculum and serves as a foundation for future projects such as:
get_next_lineft_printfminishell
- 42 Login: iarefeva
This project is for educational purposes as part of 42 School training.