libft is the first step in the 42 curriculum.
at 42, we're encouraged to understand data structures and algorithms deeply.
that's why this project involves re-making of the standard c library functions with addition of some extras.
this project is crucial because this library will be used in all our projects later on.
these are some resources i used:
• c references from geeksforgeeks
• c references from tutorialspoint
• c library references from cplusplus
• this learn c programming course
-
clone this repository:
git clone [email protected]:idleira/libft.git libft && cd libft; -
make the project: •
maketo compile mandatory part of the project; •make bonusto compile with bonus functions. -
to use the library, complie your file with the .a library file:
gcc your_file.c libft/libft.a; -
run your executable with
./a.out; -
to clean up:
• use
make cleanto remove .o files;• use
make fcleanto clean up the project directory by removing all generated files.
libft contains 43 functions.
→ all function names start with ft_ (stands for "forty two").
- c library: some of the standard c functions;
| ft_isalpha | ft_toupper | ft_memcpy | ft_strrchr |
| ft_isdigit | ft_atoi | ft_memmove | ft_strnstr |
| ft_isalnum | ft_bzero | ft_memcmp | ft_strncmp |
| ft_isascii | ft_calloc | ft_memcmp | ft_strncmp |
| ft_isprint | ft_memset | ft_strdup | ft_strlen |
| ft_tolower | ft_memchr | ft_strchr | ft_strlcat |
- extra: functions that will be useful for later projects at 42;
| ft_itoa | ft_strtrim | ft_putnbr_fd | ft_putendl_fd |
| ft_split | ft_strmapi | ft_putchar_fd | ft_striteri |
| ft_strjoin | ft_substr | ft_putstr_fd |
- bonus: functions useful for linked list manipulation.
| ft_lstsize | ft_lstnew | ft_lstadd_back | ft_lstiter |
| ft_lstlast | ft_lstmap | ft_lstadd_front | ft_lstdelone |
