A collection of foundational C libraries built from scratch to deepen understanding of memory management, strings, and low-level programming.
This repository contains three base libraries I built for future C projects at 42 and beyond:
A custom reimplementation of the C standard library — built from scratch to fully understand memory, pointers, and core functions.
- Reimplements standard C library functions (
strlen,memcpy,atoi, etc.) - Includes a
bonuspart with linked list utilities (t_list) - Used as a base library for all following C projects
- Continuously reinforced and improved through each new project
Line-by-line file reader in C A low-level implementation of a function that reads files line by line, managing buffers and memory efficiently.
- Handles newline placements, buffer overflows, and EOF correctly
- Supports multiple file descriptors via the bonus version
- Helps master buffer logic, memory allocation, and static variables
Custom implementation of printf()
A functional recreation of the standard printf() function, using only basic write() calls.
- Supports format specifiers:
%c,%s,%p,%d,%i,%u,%x,%X,%% - Built to understand variadic functions and formatted output
- Used across other projects for formatted logging and debugging
- Clone the repository
git clone https://github.com/Yuxin29/Mini_C_Library.git
cd Mini_C_Library
- Compilation Run the following in each library’s directory:
$ make # Compile all mandatory functions
$ make bonus # Compile extra bonus functions
$ make clean # Remove object files
$ make fclean # Remove object files and static library
$ make re # Recompile everything from scratch
- Include in Your Project
#include "libft.h"
and compile with:
gcc your_file.c -L. -lft
I used multiple online testers to test my libft. These testers has different emphasises, covering different edge cases. There are cases where my libft does not pass all tests, but I have reasoned it and compromised for a balanced solution. Testers that I used include: Tripouille/LibftTester