Welcome to ft_printf
, a custom implementation of the classic C library function printf
. This project is part of the 42 School curriculum, designed to deepen understanding of variadic functions in C and to replicate the functionality of the standard printf
function with support for several format specifiers.
The ft_printf
function aims to mimic the behavior of the standard C printf
function, allowing formatted output to the standard output stream. This implementation serves as an excellent learning tool for C programming, focusing on handling variadic arguments, string parsing, and formatted output.
- Format Specifiers: Supports a variety of format specifiers, including
%c
,%s
,%p
,%d
,%i
,%u
,%x
,%X
, and%%
. - Width and Precision: Handles width and precision for numerical values, improving the formatting capabilities.
- Variadic Function Handling: Demonstrates the use of variadic functions to accept an undefined number of arguments.
To use ft_printf
in your C projects, follow these steps:
- Clone the Repository: Clone the
ft_printf
repository to your local machine.git clone https://github.com/byquangthanh/ft_printf.git
- Compile the Library: Navigate to the cloned directory and compile the library using
make
.This command generates acd ft_printf make
libftprintf.a
library file. - Include in Your Project: Include the
ft_printf
header in your C files.#include "ft_printf.h"
- Link the Library: When compiling your project, link against
libftprintf.a
.cc -o your_program your_source_files -L. -lftprintf
Contributions to ft_printf
are welcome! Whether it's adding new features, fixing bugs, or improving documentation, here's how you can contribute:
- Fork the repository on GitHub.
- Create a new branch for your changes.
- Commit your improvements to the branch.
- Push the branch to GitHub.
- Submit a pull request to the original repository.
If you have any questions or encounter issues, please open an issue on the GitHub repository, and we'll do our best to address it.