This repository contains a custom implementation of the printf
function in C programming language. The printf
function is a powerful tool for formatted output, and this implementation provides a simplified version for educational purposes and customization.
- Basic Formatting: Support for
%s
,%d
,%c
, and other basic format specifiers. - Variable Arguments: Handle a variable number of arguments.
- Buffering: Implement buffering techniques for efficient output handling.
- Customization: Easy to customize and extend for specific formatting needs.
To use the custom printf
function in your C program, follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/SageLovedayy/printf.git
-
Include the
main.h
header file in your C file:#include "main.h"
-
Call the
_printf
function with the desired format and arguments:_printf("Hello, %s! The answer is %d.\n", "World", 42);
-
Compile your program with the custom
printf
implementation:gcc -Wall -Werror -Wextra -pedantic -std=gnu89 _printf.c my_program.c -o my_program
-
Run the compiled program:
./my_program
Feel free to customize the _printf
function according to your specific requirements. You can modify the format specifiers, implement additional features, or optimize the buffering strategy.
Special thanks to the ALX community for inspiration, training and support.