Welcome to the holberton-printf repository! This project is part of the curriculum at Holberton School and focuses on creating a custom implementation of the _printf
function in C. The goal is to replicate the standard functionality of _printf
while exploring the intricacies of string formatting and output generation.
This project aims to implement a custom _printf
function capable of handling various format specifiers such as characters, strings, integers, percentages, and even a custom %r
specifier for reversing strings.
- Custom Format Specifiers: Extends the traditional
_printf
with additional custom format specifiers. - String Reversal: Introduces
%r
specifier for reversing strings, adding a unique touch to the standard functionality. - Modular Design: Codebase is organized into modular files for better maintainability and readability.
main.h
: Header file containing function prototypes._printf.c
: Main implementation of the printf function.get_fun.c
: Additional helper functions.num_print.c
: handle the number.- ...
- Compiled on Ubuntu 14.04 LTS.
- Programs and functions will be compiled with gcc 4.8.4 using the flags
-Wall -Werror -Wextra -pedantic
. - Follows the Betty style.
- No use of global variables.
- No more than 5 functions per file.
- Prototypes of the functions are in the
main.h
header file.
To use the _printf
function in your program, include the main.h
header file and link it with the compiled printf files.
#include "main.h"
int main(void)
{
_printf("Hello, %s! The answer is %d.\n", "world", 42);
return 0;
}