the "Printf" project within the ALX Software Engineering program. This project explores the implementation of the printf
function in the C programming language.
The printf
function is a fundamental and powerful function in C that allows formatted output. This project focuses on understanding the inner workings of printf
and implementing a simplified version of it.
- main.h: Header file containing function prototypes and necessary includes.
- _printf.c: Main source file with the
_printf
function and supporting functions. - _any_file.c: Main source file with the helper functiosns used to handle some formats.
%c
%s
%%
%d
%i
%b (builtin format binary represention)
%u
%o
%x
%X
- clone the
printf
using this command:
git clone https://github.com/aeiedamo/printf.git
-
include header file 'main.h' in your C program:
#include "main.h"
-
Call the
_printf
function with the desired format specifiers.int main() { _printf("Hello, %s! Your age is %d.\n", "John", 25); return 0; }