This project is about coding a C library. It contains a lot of general purpose functions that the following programs rely on.
Every .c file compiles with the flags -Wall -Wextra -Werror.
Enter the repository with cd and add a "main.c" with touch main.c.
For example copy paste the following code into main to test the ft_atoi function:
#include "libft.h"
#include <stdio.h>
int main()
{
int convert;
char string[5] = "-+48";
char *str;
str = &string[0];
convert = ft_atoi(str);
printf ("%d\n", convert);
return 0;
}
Run make (to run the Makefile that will compile the source code and create the library).
You should now see a libft.a file and some object files (.o).
To clean up (removing the .o files), call make clean.
Compile your .c files with gcc using gcc main.c libft.a. You need to include the libft.a to tell the file which library it is using.
Now you can run the code using ./a.out.
