Skip to content

metaskinn/ft_printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project has been created as part of the 42 curriculum by metaskin.

ft_printf

Description

This project re-implements a small, mandatory subset of printf() as a static library libftprintf.a. The required conversions are:

  • %c %s %p %d %i %u %x %X %%

Instructions

Build the library:

make

This produces libftprintf.a at the repository root.

Clean:

make clean

Full clean:

make fclean

Rebuild:

make re

Algorithm & architecture

  1. ft_printf(format, ...) initializes a va_list and calls the parser.
  2. The parser scans the format string left-to-right.
    • Normal chars are written immediately with write(1, ...).
    • When a % is found, the next char is treated as a specifier and dispatched.
  3. Each conversion handler prints its representation and returns the number of characters written.

Resources

  • man 3 printf
  • man stdarg

AI usage

No AI was used for solving the core logic of this project. AI tools were used only for reviewing code style and verifying norm compliance.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors