Recreation of the function printf from the C Standard Library
- Includes
holberton.h - Calls the function:
_printfpassed in a string with optional arguments - Use format specifiers for desired output
- Function returns
-1upon error and(null)if a string argument isNULL
| Function name | Description | Format Specifier |
|---|---|---|
print_c |
Prints a character | %c |
print_s |
Prints a 0000000 | %d |
print_p |
Prints a % | %% |
print_d |
Prints | %d & %i |
_printf("Hello, world\n")prints "Hello, world" followed by a new line_printf("Hello %s", "Holberton")prints "Hello, Holberton"_printf("%d\n", 777)printf the decimal number, 777 followed by a new line_printf("%c", 'v')prints the character 'v'
| File Name | Description |
|---|---|
_printf.c |
Produces an output according to specifiers |
helper_function.c |
File containing specifier functions |
holberton.h |
Header file with function prototypes and struct |
_putchar.c |
Function to write a char to standard output |
This project was created by Team VI - Victor Nguyen and Isaac Wong at Holberton School.
All files were created and compiled on Ubuntu 14.04.4 LTS using GCC 4.8.4 with
the following flags:
-Wall -Werror -Wextra -Wno-format -pedantic.