Custom implementation of the C standard library, built from scratch as part of the 42 Madrid curriculum.
This library serves as the foundation for all future C projects at 42 — no external functions allowed, everything reimplemented by hand.
libft/
├── src/ # Mandatory functions
├── bonus/ # Linked list functions
├── includes/ # libft.h header
├── Makefile
└── README.md
Character Checks & Conversions
Function
Description
ft_isalpha
Checks if character is alphabetic
ft_isdigit
Checks if character is a digit
ft_isalnum
Checks if character is alphanumeric
ft_isascii
Checks if character is ASCII
ft_isprint
Checks if character is printable
ft_toupper
Converts character to uppercase
ft_tolower
Converts character to lowercase
Function
Description
ft_strlen
Returns the length of a string
ft_strchr
Locates a character in a string
ft_strrchr
Locates last occurrence of a character
ft_strncmp
Compares two strings up to n characters
ft_strnstr
Finds a substring in a string
ft_strdup
Duplicates a string
ft_substr
Extracts a substring
ft_strjoin
Concatenates two strings
ft_strtrim
Trims characters from both ends of a string
ft_split
Splits a string by a delimiter
ft_strmapi
Applies a function to each character
ft_striteri
Applies a function to each character with index
ft_strlcpy
Copies a string with size limit
ft_strlcat
Concatenates strings with size limit
Function
Description
ft_memset
Fills memory with a constant byte
ft_bzero
Zeroes out memory
ft_memcpy
Copies memory area
ft_memmove
Moves memory area safely
ft_memchr
Scans memory for a character
ft_memcmp
Compares two memory areas
ft_calloc
Allocates and zeroes memory
Function
Description
ft_atoi
Converts a string to integer
ft_itoa
Converts an integer to string
Function
Description
ft_putchar_fd
Writes a character to a file descriptor
ft_putstr_fd
Writes a string to a file descriptor
ft_putendl_fd
Writes a string followed by newline
ft_putnbr_fd
Writes an integer to a file descriptor
Function
Description
ft_lstnew
Creates a new list node
ft_lstadd_front
Adds a node at the beginning
ft_lstadd_back
Adds a node at the end
ft_lstsize
Returns the number of nodes
ft_lstlast
Returns the last node
ft_lstdelone
Deletes a single node
ft_lstclear
Deletes all nodes
ft_lstiter
Applies a function to each node
ft_lstmap
Creates a new list from applying a function
make # compile mandatory part
make bonus # compile with linked list functions
make clean # remove object files
make fclean # remove object files and libft.a
make re # full rebuild
gcc main.c -L. -lft -o program
Aitor Alonso Jusdado — 42 Madrid — LinkedIn