This repository contains the third project of 42 curriculum, the Printf function. This projects make we replicate the original printf()
function part of <stdio.h>
library
Our printf function does not need to manage a buffer but should return an integer representing the size of the printed output. It needs to support the following types of variables:
char
type variables: %c
string
type variables: %s
int
type variables: %d
unsigned int
type variables: %u
hexadecimal int
type variables (both uppercase and lowercase): %x
and %X
pointer
type variables: %p
The biggest challenge in this project is handling multiple arguments and returning a integer that is correct.
The functions are written in C language and need the gcc
compiler, with <stdlib.h>
, <stdarg.h>
and <unistd.h>
standard libraries to run.
To compile the project, go to its path and run:
For mandatory functions:
$ make
To delete all files generated with make, go to the path and run:
$ make fclean
To use this project in your code, simply include this header:
#include "ft_printf.h"
This function have been tested with Francinette.