Skip to content

Repository files navigation

printf

Ft_Printf

A Reimplementation of the C printf Function

Contributors Forks Stargazers Issues License


🇬🇧 English

📖 Click to expand/collapse English version

About

Ft_Printf is a compulsory project for 42 School students. It consists of reimplementing the standard printf function in C, creating a static library that mimics the behavior of the original printf().

This project teaches:

  • Variadic functions and argument handling
  • Format specifier parsing
  • Memory management for string formatting
  • Modular code organization
  • Code documentation and norming standards

📋 Table of Contents

✨ Features

  • Complete printf reimplementation with all standard conversions
  • Strict C89/C99 compliance with 42 School norming standards
  • Fully documented with clear purpose statements
  • Production-ready static library compilation

🚀 Installation

# Clone the repository
git clone https://github.com/HaruSnak/42-ft_printf
cd 42-ft_printf

# Compile the library
make

💻 Usage

Include the library in your C projects:

#include "ft_printf.h"

Compile your program linking against the library:

gcc your_program.c libftprintf.a -o your_program
./your_program

📂 Project Structure

ft_printf/
├── Makefile                 # Build configuration
├── ft_printf.h             # Main header file
├── ft_printf.c             # Main printf function
├── ft_conv_primary.c       # Primary conversion handlers
├── ft_conv_specifies.c     # Specific conversion functions
├── ft_conv_suit.c          # Conversion suite utilities
├── ft_putchar_fd.c         # Character output to file descriptor
├── ft_putchar.c            # Character output
├── ft_putnbr.c             # Number output
├── ft_putstr.c             # String output
└── ft_strlen.c             # String length calculation

🛠️ Makefile Targets

Target Description
make or make all Compile library and create libftprintf.a
make clean Remove object files
make fclean Remove object files and library
make re Full recompilation

📚 Function Reference

Main Function

  • ft_printf - Reimplementation of printf with format specifiers

Conversion Handlers

Utility Functions

👨‍🎓 Note

100/100

📖 Credits

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🇫🇷 Français

📖 Cliquez pour développer/réduire la version française

À propos

Ft_Printf est un projet obligatoire pour les étudiants de l'école 42. Il s'agit de réimplémenter la fonction printf standard en C, créant une bibliothèque statique qui imite le comportement de printf() originale.

Ce projet enseigne :

  • Les fonctions variadiques et la gestion des arguments
  • L'analyse des spécificateurs de format
  • La gestion de la mémoire pour le formatage des chaînes
  • L'organisation modulaire du code
  • La documentation du code et les normes de programmation

📋 Table des matières

✨ Caractéristiques

  • Réimplémentation complète de printf avec toutes les conversions standard
  • Conformité stricte C89/C99 avec les normes de l'école 42
  • Entièrement documentées avec des descriptions claires
  • Prêtes pour la production avec compilation en bibliothèque statique

🚀 Installation

# Cloner le dépôt
git clone https://github.com/HaruSnak/42-ft_printf
cd 42-ft_printf

# Compiler la bibliothèque
make

💻 Utilisation

Incluez la bibliothèque dans vos projets C :

#include "ft_printf.h"

Compilez votre programme en le liant à la bibliothèque :

gcc your_program.c libftprintf.a -o your_program
./your_program

📂 Structure du projet

ft_printf/
├── Makefile                 # Configuration de compilation
├── ft_printf.h             # Fichier d'en-tête principal
├── ft_printf.c             # Fonction printf principale
├── ft_conv_primary.c       # Gestionnaires de conversions primaires
├── ft_conv_specifies.c     # Fonctions de conversions spécifiques
├── ft_conv_suit.c          # Utilitaires de suite de conversions
├── ft_putchar_fd.c         # Écriture de caractère sur descripteur fichier
├── ft_putchar.c            # Écriture de caractère
├── ft_putnbr.c             # Écriture de nombre
├── ft_putstr.c             # Écriture de chaîne
└── ft_strlen.c             # Calcul de longueur de chaîne

🛠️ Cibles du Makefile

Cible Description
make ou make all Compiler la bibliothèque et créer libftprintf.a
make clean Supprimer les fichiers objets
make fclean Supprimer les fichiers objets et la bibliothèque
make re Recompilation complète

📚 Référence des fonctions

Fonction principale

  • ft_printf - Réimplémentation de printf avec spécificateurs de format

Gestionnaires de conversions

Fonctions utilitaires

👨‍🎓 Note

100/100

📖 Crédits

📄 Licence

Ce projet est sous licence MIT - voir le fichier LICENSE pour plus de détails.


About

Project 42 | Level 1 - Common Core | Replica of the Printf function

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Contributors

Languages