This project is the first step of the 42 curriculum. It aims to implement your own standard C library and improve your knowledge of basic C (data types, memory). This library will be reused during the 42 cursus.
| Category | Examples |
|---|---|
| Memory | memset, memcpy, bzero, calloc |
| Strings | strlen, strdup, strjoin, substr |
| Char | isalpha, isdigit, toupper |
| Convert | atoi, itoa |
| Linked list | lstnew, lstadd_back, lstsize |
# Clone repo
git clone https://github.com/yannallo/libft.git
# Build library
make -C libftAt this point you should have a libft.a (Archive containing all the object file). You will need to include "libft.h" and link the library when compiling.
gcc -Ilibft main.c -Llibft -lft -o test#include "libft.h"
#include <stdio.h>
int main(void)
{
char *s = ft_strdup("A simple string !!");
printf("%s\n", s);
free(s);
return 0;
}