This repository contains my implementation of the ft_printf project. The aim of the project is to recreate the C Standard Library function - printf(). This project helps to explore the concept of variadic functions in C and further enhances the understanding of data types, modifiers, and formatting output in C.
The function is written in C language and thus needs the gcc
compiler and some standard C libraries to run.
- Clone this repository:
- Go to the ft_printf directory:
- Run the Makefile to compile the library:
- Now you can compile your project with this library.
git clone https://github.com/lpincoli/ft_printf42.git
cd ft_printf42
make
This will create a `libftprintf.a` library file.
gcc main.c libftprintf.a -o output
The ft_printf() function supports the following conversions:
%c
: Prints a single character.%s
: Prints a string.%p
: Prints the void * pointer argument 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 format.%X
: Prints a number in hexadecimal (base 16) uppercase format.%%
: Prints a percent sign.
For more information about the project, read the subject file.
Enjoy using my ft_printf implementation! :)