/LIBFT

Primary LanguageC

cover libft bonus

libft_badge

42 Project - LIBFT - Custom Standard C Library

Overview

LIBFT is a custom implementation of several standard C library functions, as well as additional utility functions. It is designed to provide a set of fundamental tools for C programming, enabling developers to work more efficiently by implementing common functionalities themselves.

Features

  • Standard C Functions: Includes implementations of standard C library functions such as strlen, strcpy, atoi, etc.
  • Additional Utility Functions: Offers additional utility functions that are commonly used in C programming tasks.
  • Modular Design: Functions are organized into modules for easier management and integration into projects.
  • Tested and Optimized: Each function is thoroughly tested and optimized for performance and reliability.

Usage

  1. Clone the repository:
git clone https://github.com/ychbily/LIBFT.git

2. Compile the library:

make

3. Link the library to your project:

#include "libft.h"

4. Use the functions in your code as needed.

Contents

The library contains the following fucntions:

Functions from <ctype.h>

Functions from <string.h>

Functions from <stdlib.h>

  • ft_atoi - convert a string to an integer.
  • ft_calloc - allocates memory and sets its bytes' values to 0.

Non-standard functions

  • ft_substr - returns a substring from a string.
  • ft_strjoin - concatenates two strings.
  • ft_strtrim - trims the beginning and end of string with specific set of chars.
  • ft_split - splits a string using a char as parameter.
  • ft_itoa - converts a number into a string.
  • ft_strmapi - applies a function to each character of a string.
  • ft_striteri - applies a function to each character of a string.
  • ft_putchar_fd - output a char to a file descriptor.
  • ft_putstr_fd - output a string to a file descriptor.
  • ft_putendl_fd - output a string to a file descriptor, followed by a new line.
  • ft_putnbr_fd - output a number to a file descriptor.

Linked list functions

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or create a pull request.

Acknowledgments

Completed as part of the curriculum at 1337 School in Khouribga, Morocco, achieving a perfect score of 125/125.