write (man 2 write)malloc (man 3 malloc)free (man 3 free)va_start (man 3 va_start)va_end (man 3 va_end)va_copy (man 3 va_copy)va_arg (man 3 va_arg)
Project in which the operation of the printf (_printf) is simulated, which receives string, single char, integer, decimals, and the character percentage (%)
To use this function that simulates the printf, you must clone the repository [printf](https://github.com/ch-canaza/printf) to the repository where you are working, and you must include the contents of the folder holberton.h in your folder.h
| file | description |
|---|---|
_printf.c |
simulates original printf |
_putchar.c |
simulates original putchar |
_printf_function.c |
contains functions for the printf |
holberton.h |
contains prototypes and libraries |
Your code will be compiled this way:
gcc -Wall -Wextra -Werror -pedantic -Wno-format *.c
- As a consequence, be careful not to push any c file containing a
mainfunction in the root directory of * * your project (you could have a test folder containing all yourtestsfiles includingmainfunctions) - Our main files will include your main header file (
holberton.h):#include holberton.h - You might want to look at the gcc flag
-Wno-formatwhen testing with your_printfand the standardprintf.
0. I'm not going anywhere. You can print that wherever you want to. I'm here and I'm a Spur for life
function that produces output according to a format.
- Prototype:
int _printf(const char *format, ...); - Returns: the number of characters printed (excluding the null byte used to end output to strings)
- write output to stdout, the standard output stream
formatis a character string. The format string is composed of zero or more directives. See man 3printf- for more detail. You need to handle the following conversion specifiers:
cs%
- You don’t have to reproduce the buffer handling of the C library printf function
- You don’t have to handle the flag characters
- You don’t have to handle field width
- You don’t have to handle precision
- You don’t have to handle the length modifiers
Handle the following conversion specifiers:
di- You don’t have to handle the flag characters
- You don’t have to handle field width
- You don’t have to handle precision
- You don’t have to handle the length modifiers
Ricardo Camayo
Christian Nazareno