📖 Click to expand/collapse English version
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
- 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
# Clone the repository
git clone https://github.com/HaruSnak/42-ft_printf
cd 42-ft_printf
# Compile the library
makeInclude 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_programft_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
| 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 |
ft_printf- Reimplementation of printf with format specifiers
ft_conv_primary- Handles primary conversions (c, s, p, d, i, u, x, X, %)ft_conv_specifies- Specific conversion implementationsft_conv_suit- Conversion suite utilities
ft_putchar_fd- Write character to file descriptorft_putchar- Write character to stdoutft_putnbr- Write number to stdoutft_putstr- Write string to stdoutft_strlen- Calculate string length
- 42 School Norm: Official C Coding Standard
- Printf IBM Documentation: IBM Documentation Printf
- Wikipedia Printf: Wikipedia Printf
This project is licensed under the MIT License - see the LICENSE file for details.
📖 Cliquez pour développer/réduire la version française
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
- Caractéristiques
- Installation
- Utilisation
- Structure du projet
- Cibles du Makefile
- Référence des fonctions
- Crédits
- 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
# Cloner le dépôt
git clone https://github.com/HaruSnak/42-ft_printf
cd 42-ft_printf
# Compiler la bibliothèque
makeIncluez 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_programft_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
| 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 |
ft_printf- Réimplémentation de printf avec spécificateurs de format
ft_conv_primary- Gère les conversions primaires (c, s, p, d, i, u, x, X, %)ft_conv_specifies- Implémentations de conversions spécifiquesft_conv_suit- Utilitaires de suite de conversions
ft_putchar_fd- Écrire caractère sur descripteur fichierft_putchar- Écrire caractère sur stdoutft_putnbr- Écrire nombre sur stdoutft_putstr- Écrire chaîne sur stdoutft_strlen- Calculer longueur de chaîne
- Norme 42: Standard C officiel
- Printf IBM Documentation: IBM Documentation Printf
- Wikipedia Printf: Wikipedia Printf
Ce projet est sous licence MIT - voir le fichier LICENSE pour plus de détails.

