The libft project consists of creating your own first library by reproducing already existing functions. You can use libft on other 42 projects as long as it is allowed, so it will be updated frequently.
You can see the subject HERE
1- Clone this repository
git clone https://github.com/MGuardia10/42cursus_libft.git
2- Navigate to the new directory and run make
cd 42cursus_libft
make
3- make clean
to remove the object files and work on a cleaner directory
make clean
4- Include the libft header on your files and compile with the libft.a
file.
#include "inc/libft.h"
int main(void)
{
char *str = "123456";
int num = ft_atoi(str);
ft_printf("%d\n", num);
return (0);
}
The libft comes with a Makefile that includes the following rules:
all
: compiles the libraryre
: recompiles the libraryclean
: removes all object filesfclean
: removes all object files andlibft.a
At 42School, almost every project must be written in accordance to the Norm, the school's coding standard. As a result, the implementation of certain parts may appear strange and for sure had room for improvement.