Library of Functions.
Library of basic functions developed with the C programming language.
This is a project developed in the cursus of 42Madrid.
This project consists of programming a library in C. The library will have many general-purpose functions that will support the following programs to be developed during the cursus.
You will have to redo some libc functions. Your functions will have the same prototypes will have the same prototypes and implement the same behaviors as the original functions. They should be as described by the man. The only difference will be the nomenclature. They will start with the prefix “ft_”. For example, strlen will become ft_strlen.
isalpha | toupper |
isdigit | tolower |
isalnum | strchr |
isascii | strrchr |
isprint | strncmp |
strlen | memchr |
memset | memcmp |
bzero | strnstr |
memcpy | atoi |
memmove | calloc |
strlcpy | strdup |
strlcat |
In this second part, you will have to develop a set of functions that are either not from the libc library, or are but in a different form.
ft_substr | ft_strjoin |
ft_strtrim | ft_split |
ft_itoa | ft_strmapi |
ft_striteri | ft_putchar_fd |
ft_putstr_fd | ft_putendl_fd |
ft_putnbr_fd |
The functions to manipulate memory and strings are very useful… But you will soon discover that list manipulation is even more so. You should use the following structure to represent a node in your list. Add the declaration to your libft.h file:
typedef struct s_list
{
void *content;
struct s_list *next;
} t_list;
The members of the t_list structure are:
Implement the following functions to easily use your lists:
ft_lstnew | ft_lstadd_front |
ft_lstsize | ft_lstlast |
ft_lstadd_back | ft_lstdelone |
ft_lstclear | ft_lstiter |
ft_lstmap |
The whole project was done fulfilling all its requirements, delivering also a Makefile which compiles a static library libft.a with all the developed functions.
View the source code here
Project completed
Rating: