Libft is the first project at 42 Wolfsburg. It is a custom implementation of essential C standard library functions and additional utilities designed to deepen your understanding of C programming fundamentals.
Libft provides a variety of essential programming tasks, including:
- String Manipulation: Functions to measure, modify, and join strings.
- Character Checks: Functions to identify character types (e.g., digits, alphabetic characters).
- Memory Manipulation and Allocation: Functions to copy, set, move, and allocate memory.
- Data Conversion: Functions like
ft_atoi
andft_itoa
to convert data between formats.
To see the complete list of available functions and their prototypes (return types, names, and arguments), refer to libft.h
.
- A C compiler (e.g.,
gcc
orcc
).
- Clone this repository:
git clone https://github.com/gabrielgaraujo/libft.git cd libft
- Build the library:
make
- Include
libft.a
in your projects by adding it to your linker flags:gcc your_program.c -L. -lft -o your_program
- Remove object files:
make clean
- Remove object files and the compiled library:
make fclean
- Rebuild the library from scratch:
make re
Here's a simple program using libft
:
#include "libft.h"
#include <stdio.h>
int main() {
const char *str = "Hello, World!";
printf("Length: %zu\n", ft_strlen(str));
return 0;
}
Compile it with:
gcc main.c -L. -lft -o main
./main
Crafted with care during the 42 Wolfsburg journey by Gabriel Araujo.