Skip to content
PAYTheVendettaPublic

About

recreacion de la funcion printf de la libc

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_printf

Recreation of the C standard library printf function, built from scratch as part of the 42 Madrid curriculum.

The goal was to understand variadic functions, format string parsing, and low-level data representation without relying on the original libc implementation.


Project Structure

printf/
├── ft_printf.c   # Main function and format parser
├── ft_printf.h   # Header file
├── utils.c       # Helper functions
└── Makefile

Supported Conversions

Specifier Description
%c Single character
%s String
%p Pointer address in hexadecimal
%d Decimal integer
%i Integer
%u Unsigned decimal integer
%x Hexadecimal (lowercase)
%X Hexadecimal (uppercase)
%% Literal percent sign

Usage

Compilation

make        # compile
make clean  # remove object files
make fclean # remove object files and library
make re     # full rebuild

Using in your project

#include "ft_printf.h"
gcc main.c -L. -lftprintf -o program

Example

ft_printf("Hello, %s! Number: %d\n", "world", 42);
ft_printf("Pointer: %p | Hex: %x\n", ptr, 255);

What I Learned

  • Variadic functions — va_list, va_start, va_arg, va_end
  • Format string parsing
  • Base conversion (decimal, hexadecimal)
  • Writing modular and reusable C code

Author

Aitor Alonso Jusdado — 42 Madrid — LinkedIn

About

recreacion de la funcion printf de la libc

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages