_printf is the implementation of the printf function that prints strings, characters and numbers.
_printf function was developed and tested on Ubuntu 14.04 LTS
via Vagrant in VirtualBox.
The repository contains the following files:
File | Description |
---|---|
_printf.c | The printf function |
holberton.h | Header file containing all function prototypes and struct declaration |
helper_func.c | Containing helper functions to print character, string and numbers |
morefunctions.c | Containing helper function |
Function | Description |
---|---|
int print_char(va_list args) | prints a character |
int print_str(va_list args) | Prints a string |
int print_dec(va_list args) | Prints a number |
int printchar(char c) | Writes a character to stdout |
int _strlen(char *str) | calculates the lenght of the string |
char *ft_itoa_base(int value, char *text, int base) | convert integer to alpha convention |
long max_power(long nb, int base) | determines max power |
int handlebackslash(const char *format, int place, int len) | checking the next position after backslash |
int _printf(const char *format, ...) | prints strings, characters and numbers to stdout |
Clone the repository, compile with comliation flags, listed below, then run the executable.
$ git clone https://github.com/sanjurosaves/printf.git
This code was compiled this way:
$ gcc -Wall -Wextra -Werror -pedantic -Wno-format *.c -o printf
int main(void)
{
_printf("Hello %s\n", "World");
return (0);
}
=========================================
$ ./printf
Hello World
$
Alex Allen, Elena Serebryakova