This project, part of the 42 network's curriculum, aims to recreate the standard C library function printf. The ft_printf function will be able to handle various format specifiers, modifiers, and flags, just like the original printf function.
- Supports basic format specifiers (e.g.,
%c,%s,%d,%x,%f). - Handles width and precision modifiers.
- Supports length modifiers (e.g.,
hh,h,l,ll). - Implements some flags (e.g.,
0,-,+,#,). - Handles conversion of floating-point numbers with a specified precision.
-
Clone the repository:
git clone https://github.com/aminezagh/ft_printf.git
-
Navigate to the project directory:
cd ft_printf -
Compile the project:
make
-
Include the
ft_printf.hheader in your project and use theft_printffunction:#include "ft_printf.h" int main() { ft_printf("Hello, %s!\n", "world"); return 0; }
-
Compile your project with the
libftprintf.alibrary:gcc -o my_program my_program.c libftprintf.a
-
Run your program:
./my_program
srcs/: Contains the source code files.includes/: Contains the header files.libftprintf.a: The compiled library.Makefile: Makefile for compiling the project.
- This project was developed as part of the 42 network curriculum.
- Contributions and bug reports are welcome! Feel free to open an issue or submit a pull request.