This is the ft_printf project for the 42 school curriculum. The project focuses on recreating the standard C library function printf
. The goal is to implement a versatile and extensible printf function that can handle various format specifiers and modifiers.
- Basic Conversion Specifiers: Support for
%c
,%s
,%p
,%d
,%i
,%u
,%x
,%X
, and%o
. - Width and Precision: Handle minimum field width and precision.
- Flags: Implement flags such as
0
,-
,+
,#
, and - Length Modifiers: Recognize length modifiers like
hh
,h
,l
, andll
.
- GCC compiler
- GNU Make
-
Clone the repository:
git clone https://github.com/yourusername/ft_printf.git
-
Change into the project directory:
cd ft_printf
-
Build the project:
make
-
Use ft_printf in your project:
Include the header file in your source code and link with the compiled library.
#include "ft_printf.h"
Use the ft_printf
function as a drop-in replacement for the standard printf
function:
#include "ft_printf.h"
int main() {
ft_printf("Hello, %s!\n", "World");
return 0;
}