Skip to content

Libft is a custom C library developed as part of the 42 São Paulo Common Core curriculum. It features reimplementations of standard C functions (e.g., ft_strlen, ft_memcpy), additional utilities (e.g., ft_substr, ft_split), and bonus linked list functions.

Notifications You must be signed in to change notification settings

LuizGandra/libft-42

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Libft - A Custom C Library

Libft is a project from the 42 São Paulo Common Core curriculum. It consists of a static C library (libft.a) containing general-purpose functions designed to serve as foundational tools for subsequent C programming assignments.

42 São Paulo

About 42

42 São Paulo is a tuition-free, global coding school focused on peer-to-peer learning and project-based education. This project introduces core C programming concepts by reimplementing standard library functions and creating custom utilities.

Project Overview

Libft provides a collection of functions split into two sections:

  • Mandatory Part: Reimplementations of libc functions (e.g., ft_strlen, ft_memcpy) and additional tools (e.g., ft_substr, ft_split).
  • Bonus Part: Linked list manipulation functions (e.g., ft_lstnew, ft_lstadd_front).

Key Features

  • Rebuilt standard C functions with the ft_ prefix.
  • Custom string and memory manipulation utilities.
  • Bonus linked list management using a t_list structure.
  • Strict memory management with no leaks.

Restrictions

  • Written in C, compliant with the 42 Norm.
  • No global variables or unexpected crashes.
  • Compiled with -Wall -Wextra -Werror.
  • Limited external functions (e.g., malloc, free, write).

Getting Started

Prerequisites

  • C compiler (e.g., clang).
  • make utility.

How to Build and Run

  1. Clone the repository:

    git clone https://github.com/LuizGandra/libft-42.git
    cd libft-42
    
  2. Build the mandatory part:

    make
    
  3. Build the bonus part (optional):

    make

This includes linked list functions in libft.a.

  1. Link the library to your C project:

    clang -o <program> <file>.c -L<libft.a directory> -lft
    

Additional commands

  • make clean: remove object files.
  • make fclean: remove the program and object files.
  • make re: rebuild everything.

Project Structure

  • libft.h: function prototypes.
  • ft_*.c: mandatory function sources.
  • ft_*_bonus.c: bonus function sources.
  • Makefile: compilation automation.

License

This project is part of the 42 curriculum and intended for educational use.

About

Libft is a custom C library developed as part of the 42 São Paulo Common Core curriculum. It features reimplementations of standard C functions (e.g., ft_strlen, ft_memcpy), additional utilities (e.g., ft_substr, ft_split), and bonus linked list functions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published