A boiled down printf implementation
This project involves the creation of a custom implementation of the printf
function in the C programming language. printf
is a standard output formatting function that is widely used in C and other programming languages. The goal of this project is to create a simplified version of printf
, supporting a subset of format specifiers and providing essential functionality for formatting and printing output.
- ft_printf.c: The main file containing the implementation of the
printf
function. - ft_printf.h: The header file declaring function prototypes and any necessary data structures or constants.
- ft_printf_utils.c: Utility functions used by the
printf
implementation for various tasks. - ft_flag_utils.c: Utility functions for handling format flags in the
printf
function. - ft_flags.c: Implementation of handling various format flags.
- ft_generic_utils.c: Generic utility functions that support the
printf
implementation. - ft_hex_format_utils.c: Utilities for handling hexadecimal format specifiers.
- ft_int_format_utils.c: Utilities for handling integer format specifiers.
- ft_ldtoa.c: Functions for converting long doubles to ASCII strings.
- ft_print_char.c: Implementation for printing characters.
- ft_print_hex.c: Implementation for printing hexadecimal values.
- ft_print_hex_utils.c: Utilities for printing hexadecimal values.
- ft_print_int.c: Implementation for printing integers.
- ft_print_int_utils.c: Utilities for printing integers.
- ft_print_percent.c: Implementation for printing the '%' character.
- ft_print_pointer.c: Implementation for printing pointer addresses.
- ft_print_string.c: Implementation for printing strings.
- ft_print_uint.c: Implementation for printing unsigned integers.
- ft_print_uint_utils.c: Utilities for printing unsigned integers.
- ft_ptoa.c: Functions for converting pointers to ASCII strings.
- ft_uint_format_utils.c: Utilities for handling unsigned integer format specifiers.
- ft_xtoa.c: Functions for converting integers to hexadecimal ASCII strings.
- Implement a simplified version of the
printf
function that supports basic format specifiers. - Handle various format flags, such as width, precision, and alignment.
- Support a subset of conversion specifiers, including characters, strings, integers, hexadecimal, and pointers.
- Create utility functions to enhance code modularity and maintainability.
- Test the
printf
implementation with a variety of input cases to ensure correctness and reliability.
- Clone the Repository:
git clone https://github.com/kbly538/ft_printf.git cd ft_printf
- Build the Project
make
To use the custom printf
implementation, include the "ft_printf.h" header file in your C source code and call the ft_printf
function with the desired format string and arguments.