Skip to content

A static and exapansible library in C to use in 42 projects

Notifications You must be signed in to change notification settings

gusttavocdn/42_libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LIBFT - @42SP

This was the first project of the 42 curriculum. The project aims to recreate several functions from the standard libc.

Nota: 122/100 ✔️

What is the LIBFT?

This is the first project of the 42 curriculum. It consists of recreating various standard functions of the language to be used during the course development, since we cannot use the originals. This is a living library and new functions can be added to it, increasing its functionalities.

Functions

Functions to handle char type

Functions to handle strings

  • ft_strlen - Calculates the length of a string.

  • ft_strlcpy - Copies a string from a buffer to another.

  • ft_strlcat - Concatenates two strings in a buffer.

  • ft_strchr - Locates the first occurrence of a character in a string.

  • ft_strrchr - Locates the last occurrence of a character in a string.

  • ft_strnrcmp- Compares two strings.

  • ft_strnstr - Locates a substring in a string.

  • ft_strdup - Allocates memory and copies a string.

  • ft_strmapi - Applies a function to each character of a string and returns a new string.

  • ft_striteri - Applies a function to each character of a string.

  • ft_substr - Allocates memory and returns a substring from a string.

  • ft_strjoin - Allocates memory and concatenates two strings.

  • ft_strtrim - Allocates memory and returns a copy of a string trimmed.

  • ft_split - Allocates memory and returns an array of strings obtained by splitting a string using a delimiter.

Function to handle memory

  • ft_memset - Fills a memory block with a same byte.

  • ft_bzero - Fill a memory block with '\0'.

  • ft_memcpy - Copies a memory area.

  • ft_memmove - Copies a memory area, even if the memory areas overlap.

  • ft_memchr - Locates a byte in a memory block.

  • ft_memcmp - Compares two memory blocks.

  • ft_calloc - Allocates memory and fills it with '\0'.

  • ft_swap.c - Swaps two variables.

Functions to handle math operations

  • ft_atoi - Converts a string to an integer.

  • ft_atoi_base - Converts a string to an integer in a given base.

  • ft_itoa - Returns a string representing an integer.

  • ft_itoa_base - Returns a string representing an integer in a given base.

  • ft_itoa_base_u - Returns a string representing an unsigned integer in a given base.

  • ft_convert_base - Converts a number from a base to another.

  • ft_calc_nbr_digits - Calculates the number of digits of a number.

  • ft_abs - Returns the absolute value of a number.

Functions to handle I/O

Notes

This is an extensible library, so I may add more functions in the future.

About

A static and exapansible library in C to use in 42 projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published