_printf is a simple custom printf function that formats and prints data to the standard output.
_printf() functiion formats and prints data to the standard output according to the format specified.
The function has the following conversion specifies:
- %c - prints a character
- %d - prints a decimal integer
- %s - prints a string
- %i - prints an integer
you can clone this repository and use the function on your local machine.
git clone https://github.com/andrew21-mch/printf.git
To add the man_3_prinf page to your mandb run this script
sudo ./install
- include the
holberton.h
header file on the function for using _printf(). - All the files are to be compiled on Ubuntu 14.04 LTS
Compile your code with `gcc -Wall -Werror -Wextra -pedantic *.c`
#include <stdio.h>
#include "holberton.h"
int main(void)
{
int i = 10;
int print;
char *s = "printf still under test by Andrew";
_printf("%d %s %c\n", i, s, 'c');
print = _printf("%d", s); /* get number of characters */
printf("%d\n", print); /* print number of characters */
return 0;
}
GNU General Public License v3.0
Copyright (c) 2021 Nfon Andrew