Welcome to Libft, your very first foray into the exhilarating world of C libraries! This project is like your personal toolbox, packed with fundamental functions that you'll find incredibly handy in your future C programming quests. Let’s dive into the details of this library and explore how it’ll become your best programming sidekick!
Libft is all about crafting a custom C library, packed with functions you'll be using across your projects. Whether you're dealing with strings, memory management, or even lists, Libft's got you covered. This is where you get to build your very own version of the standard library functions, plus a few extra goodies.
Your library will include a set of core functions that mimic the standard C library functions. Think of it as your personal rendition of:
- String Handling:
ft_strlen
,ft_strchr
,ft_strcmp
, and more. - Memory Management:
ft_memset
,ft_memcpy
,ft_calloc
. - Character Classification:
ft_isalpha
,ft_isdigit
,ft_toupper
.
Expand your library with functions that might not be in the standard library or that you might want to customize:
- String Manipulation:
ft_substr
,ft_strjoin
,ft_strtrim
. - List Operations: With the bonus part, dive into linked lists with functions like
ft_lstnew
,ft_lstadd_front
,ft_lstmap
.
If you're up for a challenge, try implementing the bonus functions to handle linked lists. These will help you manage dynamic data structures with ease. Implement functions like ft_lstadd_back
and ft_lstclear
to manipulate and manage your lists.
-
Clone the Repo:
git clone https://github.com/Nihilantropy/Libft.git
-
Navigate to your project:
cd libft
-
Compile the library
make
-
Use in your project: Simply include 'libft.h' in your projects and link against 'libft.a'
- Programming Language: C
- Standards: Must adhere to the Norm. All functions should be well-tested and free of memory leaks.
- Submission: Ensure that your code is correctly placed in the repository and includes a Makefile for building the library.
Creating your own library not only strengthens your understanding of C but also prepares you for real-world programming where you might need to develop or utilize libraries. Think of it as laying the foundation for your programming skills and having fun while doing it!
Q: Can I use external libraries?
A: No, this project is all about writing your own code. Keep it pure and fun!
Q: What if I have problems with memory leaks?
A: Make sure to use tools like Valgrind to track down and fix any memory leaks.
Q: How can I test my functions?
A: Writing your own test programs can be incredibly helpful. However you cannot push it on your repository. The best thing you can do
is to quickly learn how to use the main function and the compiler to test each function with lots of cases (check the edge cases carefully!)
See alse the libft tester on git hub!.
If you'd like to see an in-depth analisy of this code, leave a star to let me know! 💌