Skip to content

Libft is a custom implementation of essential C standard library functions. Built for learning C as part of the 42 Curriculum.

License

Notifications You must be signed in to change notification settings

gabrielgaraujo/libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libft

Libft is the first project at 42 Wolfsburg. It is a custom implementation of essential C standard library functions and additional utilities designed to deepen your understanding of C programming fundamentals.

Features

Libft provides a variety of essential programming tasks, including:

  • String Manipulation: Functions to measure, modify, and join strings.
  • Character Checks: Functions to identify character types (e.g., digits, alphabetic characters).
  • Memory Manipulation and Allocation: Functions to copy, set, move, and allocate memory.
  • Data Conversion: Functions like ft_atoi and ft_itoa to convert data between formats.

To see the complete list of available functions and their prototypes (return types, names, and arguments), refer to libft.h.

Getting Started

Prerequisites

  • A C compiler (e.g., gcc or cc).

Installation

  1. Clone this repository:
    git clone https://github.com/gabrielgaraujo/libft.git
    cd libft
  2. Build the library:
    make
  3. Include libft.a in your projects by adding it to your linker flags:
    gcc your_program.c -L. -lft -o your_program

Cleaning Up

  • Remove object files:
    make clean
  • Remove object files and the compiled library:
    make fclean
  • Rebuild the library from scratch:
    make re

Usage Example

Here's a simple program using libft:

#include "libft.h"
#include <stdio.h>

int main() {
    const char *str = "Hello, World!";
    printf("Length: %zu\n", ft_strlen(str));
    return 0;
}

Compile it with:

gcc main.c -L. -lft -o main
./main

Crafted with care during the 42 Wolfsburg journey by Gabriel Araujo.