Skip to content

mohos26/libft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libft

📘 libft is a custom C library implementing a collection of general‑purpose functions — many of which mirror the behavior of the standard C library — and additional utility functions that are commonly used in C programming. This project is part of the 42 School curriculum and serves as the foundation for future C projects by giving you a deep understanding of core concepts like memory manipulation, strings, and linked lists. ([GitHub][1])


📌 Table of Contents

  • About
  • Features
  • Getting Started
  • Usage
  • Project Structure
  • Compilation & Makefile
  • Contributing

🧠 About

The goal of this project is to re‑implement and understand a broad set of C functions from scratch, without using many of the library functions provided by <string.h>, <ctype.h>, or <stdlib.h>. Once completed, this library produces a static archive libft.a which you can link to your own C programs. ([GitHub][1])


⭐ Features

✔️ Reimplementation of standard C library functions (ft_strlen, ft_memcpy, etc.) ✔️ Additional utility functions (ft_substr, ft_split, ft_itoa, etc.) ✔️ Bonus linked list functions (ft_lstnew, ft_lstadd_front, etc.) ✔️ Designed to meet 42 norms and compile cleanly with strict flags (-Wall -Wextra -Werror) ([GitHub][1])


🚀 Getting Started

🧾 Prerequisites

  • A C compiler (like gcc or clang)
  • make

📦 Installation

  1. Clone the repository:

    git clone https://github.com/mohos26/libft.git
    cd libft
  2. Compile the library:

    make

This produces a static library libft.a.


📖 Usage

To use the library in your own C code:

  1. Include the header in your .c files:

    #include "libft.h"
  2. Link the static library when compiling:

    gcc -o my_program my_program.c -L. -lft

Replace my_program.c with your source file and adjust paths as needed.


📂 Project Structure

libft/
├─ Makefile
├─ libft.h
├─ *.c               # Mandatory functions
├─ *_bonus.c         # Linked list bonus functions
├─ libft.a           # Generated library

Typical categories of functions include:

  • Character checks & conversions (ft_isalpha, ft_toupper, …)
  • String manipulation (ft_strlen, ft_strjoin, ft_strtrim, …)
  • Memory operations (ft_memset, ft_memcpy, …)
  • File descriptor outputs (ft_putchar_fd, ft_putnbr_fd, …)
  • Linked list utilities (ft_lstnew, ft_lstadd_back, …) ([GitHub][2])

🛠 Makefile Rules

Rule Description
make Build the library with mandatory functions
make bonus Build including bonus (linked list) functions
make clean Remove object files (*.o)
make fclean Remove object files and the library (libft.a)
make re Rebuild everything from scratch

🤝 Contributing

This repository is intended to reflect your personal implementation of the 42 libft project. If you choose to share improvements, bug fixes, or testing additions, feel free to open a pull request.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors