This is a project to create a custom printf function (_printf)...by OYEKUNLE DANIEL and OLUWATOSIN MOSUNMOLA
This project implements a basic version of the printf function in the C programming language.
The printf function is a standard library function in C used for formatted output. This project provides a basic implementation of this function, allowing you to print formatted text to the console.
To use the printf function in your C program, follow these steps:
-
Include the "main.h" header file in your source code:
#include "main.h"
-
Call the
_printffunction with the desired format string and arguments:int main() { _printf("Hello, %s!\n", "world"); return 0; }
-
Compile your program, ensuring that "main.h" and the source files are included:
gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o your_program -
Run your compiled program:
./your_program
The project is organized into several functions:
_printf: The main function that mimics the behavior of the standardprintf.print_buffer: Helper function to print the contents of the buffer.- Other helper functions: Functions to handle various format specifiers, flags, widths, and precisions.
Feel free to contribute to this project by opening issues or submitting pull requests. Contributions are welcome!
- OYEKUNLE DANIEL
- OLUWATOSIN MOSUNMOLA
This project is licensed under the MIT License.