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

1fb656a · Jan 23, 2025

History

56 Commits
Dec 11, 2024
Jan 23, 2025
Jan 23, 2025
Jan 23, 2025
Dec 8, 2024
Dec 8, 2024
Dec 8, 2024
Nov 17, 2024
Nov 17, 2024
Nov 17, 2024
Nov 17, 2024
Nov 17, 2024
Dec 9, 2024
Jan 23, 2025
Jan 23, 2025
Jan 23, 2025
Jan 23, 2025
Jan 23, 2025
Jan 23, 2025
Jan 23, 2025
Jan 23, 2025
Jan 23, 2025
Dec 7, 2024
Dec 7, 2024
Dec 5, 2024
Dec 5, 2024
Nov 17, 2024
Dec 8, 2024
Dec 8, 2024
Dec 9, 2024
Dec 8, 2024
Jan 23, 2025
Dec 7, 2024
Dec 8, 2024
Dec 9, 2024
Dec 8, 2024
Dec 7, 2024
Dec 5, 2024
Nov 17, 2024
Dec 9, 2024
Dec 7, 2024
Dec 7, 2024
Dec 7, 2024
Dec 9, 2024
Dec 8, 2024
Dec 7, 2024
Dec 7, 2024
Jan 23, 2025

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.