C programming can be very tedious when one doesnβt have access to those highly useful standard functions. This project allows you to re-write those functions, understand them, and learn to use them. This library will help you with all your future C projects.
Step by step.
# Clone the project and access the folder
git clone https://github.com/willianlim/libft && cd libft/Libft
# Run Make so you can build the library
make
# Run Make with bonus if you want chained lists manipulation functions
make bonus
# Compile your main with the library, example:
cd .. && clang main_test.c Libft/libft.a
# Execute your program
./a.out
# Clean output objects with
make fclean
# Well done!
/*
Exemple of main file for teste
*/
#include <stdio.h>
#include "Libft/libft.h"
int main()
{
char str[3] = "oi";
char *num;
num = NULL;
ft_putstr_fd("String de exemplo: oi\n", STDOUT_FILENO);
ft_putstr_fd("Quantidade de bytes da string: ", STDOUT_FILENO);
num = ft_itoa(ft_strlen(str));
ft_putstr_fd(num, STDOUT_FILENO);
free(num);
ft_putstr_fd("\n", STDOUT_FILENO);
return (0);
}
ft_strlen
ft_striter
ft_striteri
ft_strcmp
ft_strncmp
ft_strdup
ft_strcpy
ft_strlcat
ft_strchr
ft_strstr
ft_strnstr
ft_strsub
ft_strjoin
ft_strtrim
ft_split
ft_lstnew
ft_lstadd_front
ft_lstisize
ft_lstlast
ft_lstadd_back
ft_lstdelone
ft_lstclear
ft_lstiter
ft_lstmap
The project is updated regularly with new functions that could be useful for other projects, or when I learn something new, or when I realize my code looks awful π
- Licença de software
LICENSE