Welcome to my libft repository! π
The libft project is an essential part of the 1337 School curriculum, where I implemented various functions from the C standard library to deepen my understanding of C programming, memory management, and pointers.
The libft project involves creating your own versions of several standard C library functions. These functions include string manipulation, memory allocation, and file handling. It is a key project that helps solidify the foundations of system-level programming in C.
-
String Functions:
ft_strlen()
ft_strcpy()
ft_strdup()
ft_strcmp()
ft_strcat()
ft_strchr()
ft_strrchr()
ft_strncat()
ft_strncmp()
ft_strlcpy()
ft_strlcat()
-
Memory Functions:
ft_memset()
ft_bzero()
ft_memcpy()
ft_memmove()
ft_memchr()
ft_memcmp()
ft_calloc()
-
Character Functions:
ft_isalpha()
ft_isdigit()
ft_isalnum()
ft_isascii()
ft_isprint()
ft_toupper()
ft_tolower()
-
Other Functions:
ft_itoa()
ft_strsplit()
ft_strjoin()
ft_strtrim()
ft_lstnew()
ft_lstadd_front()
ft_lstadd_back()
ft_lstdelone()
ft_lstclear()
ft_lstiter()
ft_lstmap()
The project is structured as follows:
libft/
β
βββ src/ # Source files for the library functions
β
βββ include/ # Header files
β βββ libft.h # Header file with function prototypes
β
βββ Makefile # Makefile to compile the project
βββ README.md # Project documentation
To use the functions in your project, include the header file libft.h
and compile the source files along with your main program. Here's an example of how to use the ft_strlen
function:
#include "libft.h"
int main() {
char *str = "Hello, world!";
int len = ft_strlen(str);
printf("Length of the string: %d
", len);
return 0;
}
-
Clone the repository to your local machine:
git clone https://github.com/samir-ouaammou/C-Library
-
Navigate to the project directory:
cd C-Library/Project
-
Compile the source files using
make
:make
-
Clean up compiled files:
make clean
-
To remove all object files and the executable:
make fclean
-
To recompile the project from scratch:
make re
Throughout this project, I encountered and overcame challenges such as:
- Implementing memory management functions without using the standard library.
- Understanding the nuances of pointers and memory allocation.
- Ensuring efficient and error-free string manipulation.
- Mastered key concepts in C programming such as memory management, pointers, and recursion.
- Built reusable, efficient functions that mimic the behavior of the C standard library.
- Gained confidence in system-level programming and debugging techniques.
With libft completed, I am now focused on:
- Building advanced projects like ft_printf and Born2beroot.
- Improving my knowledge of system programming and Linux internals.
- Expanding my skills in algorithms and data structures.
The libft project was a challenging yet rewarding experience. It pushed me to think critically about memory, pointers, and efficient code writing. I am excited to apply the skills I gained to more complex projects and continue learning and growing as a programmer.
Thank you for checking out my libft project! π Stay tuned for more updates as I continue to enhance my skills and tackle new challenges.