This repository contains our own version of the function printf, originally included in the library stdio.h.
Emulates the operation of the printf function which delivers an output according to a format composed by zero or more directives and conversion specifiers:
Specifier | Input example | Output example |
---|---|---|
%c | "Printing a char: [%c]\n", 'X' | Printing a char: [X] |
%s | "Printing a string: [%s]\n", "Hello, World" | Printing a string: [Hello, World] |
%d or %i | "Printing a number: [%i]\n", 386 | Printing a number: [386] |
%% | "Printing a percent sign: [%%]\n", % | Printing a percent sign: [%] |
gcc -Wall -Werror -Wextra -pedantic *.c
#include "main.h" /** * main - main function * Return: always 0 **/ int main() { _printf("Hello World!/n"); return (0); }
output: Hello World!
#include "main.h"
/**
* main - main function
* Return: always 0
**/
int main()
{
char string[7] = "World!"
_printf("Hello %s/n", string);
return (0);
}
output: Hello World!
#include "main.h"
/**
* main - main function
* Return: always 0
**/
int main()
{
int num = 1006
_printf("This is a number: %d/n", num);
return (0);
}
output: This is a number: 1006
This project has been tested on Ubuntu 20.04 LTS
- Sam-Oladapo Ebenezer- github - mrsamoladapo@gmail.com
- Gbenga Elegbede github - jonathangnenga@gmail.com