✅ Completed: Mandatory + Bonus
🏅 Score: 125/100
Libft is a custom implementation of some key functions from the C standard library, built as part of the curriculum at 42 School. The goal of this project is to deepen our understanding of low-level programming, memory management, and code optimization.
- Standard C Functions: Replicates many standard library functions such as
strlen,strcpy,strcat, and more. - Memory Management: Includes functions like
malloc,calloc, and custom implementations for memory manipulation (memset,memcpy, etc.). - String Manipulation: Custom implementations for string operations (
strdup,strchr,strncat, etc.). - Additional Utilities: Includes useful utility functions not found in the standard library (e.g.,
ft_split,ft_itoa).
- A Unix-like operating system (Linux, macOS, etc.).
- A C compiler (e.g.,
gcc).
To clone the repository, run the following command:
git clone https://github.com/<your-username>/libft.git
cd libftHere is a quick list of the main functions implemented in this project:
- String Functions:
ft_strlen,ft_strcpy,ft_strcmp, etc. - Memory Functions:
ft_memset,ft_bzero,ft_memcpy, etc. - Character Functions:
ft_isalpha,ft_isdigit,ft_toupper, etc.
- String Utilities:
ft_substr,ft_strjoin,ft_split, etc. - Number Conversions:
ft_itoa,ft_atoi.
- Linked List Functions:
ft_lstnew,ft_lstadd_front,ft_lstdelone, etc.
To build the library, simply run:
makeThis will generate a libft.a file that can be linked to your projects.
To clean up compiled files, use:
make cleanTo remove everything including the library file:
make fcleanTo use the library in your project, include the libft.h header and link the library:
#include "libft.h"
int main(void) {
char *str = ft_strdup("Hello, Libft!");
ft_putstr_fd(str, 1);
free(str);
return 0;
}Compile and link with:
gcc main.c -L. -lft -o my_program.
├── includes # Header files (e.g., libft.h)
├── src # Source files
├── Makefile # Makefile for building the library
├── README.md # Project documentation
└── libft.a # Compiled library (generated after `make`)
If you have any questions or suggestions, feel free to reach me out.
Thank you for checking out my Libft project! 😊