Skip to content

ItsVaguayo/Printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖨️ ft_printf

42 School
ft_printf is a custom reimplementation of the standard C printf function.
It formats and prints output to stdout using variadic arguments (va_list), mimicking the core behavior of printf.


✅ Return value

  • Returns the total number of characters printed.
  • If an error occurs, it returns a negative value.

🔧 Supported specifiers

Specifier Description
%c Character
%s String (char *)
%p Pointer (hex address)
%d / %i Signed decimal integer
%u Unsigned decimal integer
%x Hexadecimal (lowercase)
%X Hexadecimal (uppercase)
%% Prints a %

🛠️ Makefile

make
make clean
make fclean
make re

▶️ Example

#include "ft_printf.h"

int main(void)
{
    ft_printf("Hello %s (%d)\n", "world", 42);
    return (0);
}

This project was completed as part of the 42 curriculum.

About

Recreating the C printf function to learn about variadic functions and format management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors