Skip to content

A project from 42School. A custom printf function coded from 0.

Notifications You must be signed in to change notification settings

maksim-volkmann/ft_printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft_printf

Libft badge

ft_printf is a custom version of the standard C function printf. It works like printf but only supports a few specific format specifiers. This project is part of the 42 School program and focuses on clear coding and low-level programming.

Supported Format Specifiers:

%c: Prints a single character.
%s: Prints a string.
%p: Prints a pointer address in hexadecimal format.
%d: Prints a decimal (base 10) number.
%i: Prints an integer in base 10.
%u: Prints an unsigned decimal (base 10) number.
%x: Prints a number in hexadecimal (base 16) lowercase.
%X: Prints a number in hexadecimal (base 16) uppercase.
%%: Prints a percent sign.

Features:

Recreates the functionality of printf for the above specifiers. Utilizes variadic functions (va_start, va_arg, va_end) to handle dynamic arguments. Built as a static library libftprintf.a. Relies on functions from libft for core operations.

How to Compile and Run:

Simply run make in the project directory:

make

Include the library in your project:

gcc main.c -L. -lftprintf -o my_program

Use ft_printf as a drop-in replacement for printf:

ft_printf("Hello, %s! You are number %d.\n", "world", 42);

About

A project from 42School. A custom printf function coded from 0.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published