Skip to content

skyheis/42_printf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rewriting printf in C without standard libraries

Description

This project (if done with bonus) is the first big challenge of the 42 school. The goal is to rewrite the printf function in C without using standard libraries. The project is a great way to learn how to use variadic arguments, it was also a great way to learn how to use pointers and memory allocation. The function will be prototyped as follow:

int ft_printf(const char *, ...);

The function will manage the following conversions: cspdiuxX% and will manage any combination of the following flags: ’-0.*# ’ and minimum field width with all conversions. Also the project has to follow the Norm of the school.

Architecture

This was my really first time thinking about a project architecture. I wanted to make it as reusable as possible because all the conversion have similar use cases and I thought it would be a great way to thing a schema that could be used for all the conversions.

How to use

If you want to use the function, you can clone the repository and compile the library with the following command:

make

Then you can compile your program with the library:

gcc -Wall -Wextra -Werror -I./includes -L. -lftprintf main.c

Tests

I made test by hand, but I also used the following amazing work from a student of my network to test my function: printf_tester

About

ft_printf_overkill (lol, not true!)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published