ft_printf is a simplified implementation of the printf
function in C, providing basic formatting for characters, strings, integers, unsigned integers, hexadecimal, and pointers.
This project aims to provide a basic printf
functionality with support for commonly used format specifiers. It's designed to be a learning exercise and may not cover all edge cases or features of a complete standard printf
implementation.
To use ft_printf in your C project, follow these steps:
- Clone the repository:
git clone <repository-url>
- Include the
ft_printf.h
header file in your source code. - Compile your project with the
ft_printf
source files.
%c
: Character%%
: Percent sign%s
: String%d
,%i
: Signed integer%u
: Unsigned integer%x
: Hexadecimal (lowercase)%X
: Hexadecimal (uppercase)%p
: Pointer
To build the project, you can use a simple Makefile or compile the source files manually. Here's an example using GCC:
gcc -Wall -Wextra -Werror -c ft_printf.c ft_print_char.c ft_print_str.c ... # Add all source files
gcc -o your_program your_source_file.c ft_printf.o ft_print_char.o ft_print_str.o ... # Add all object files