Raid55 / printf

A printing function that prints more than just f

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_printf

Summary

This is a miniature version of the popular function printf() part of the #include <stdio.h>. It scans a format string for flags and replaces them with datatype the flag points to (see chart below). It prints the string and returns the amount of chars printed to stdout. If the function fails, it will print until the moment it fails and return -1.

Files

Files Description
_printf.c Main file, printf and vprintf logic
print_funcs.c Functions that handle printing of specific main flags
print_funcs_extra.c Extra functions needed to handle printing of extra flags
helpers.c Helps certain function complete their task
utils.c Holds utility functions, such as _putchar
holberton.h File that holds all prototypes and data structs and others

Usage

_printf([FORMAT], [...]);

Flags Description
%c Prints a single char
%s Prints string
%i Prints Integer
%d Prints a decimal value...same as above
%r Prints a string in reverse
%R Prints string in ROT13 encryption

Example

_printf("%s is %d years old in mental age", "Raid55", 14) _printf("%R is gibberish and this %r", "this will be printed in ROT13", "this will be in rev")

Notes

Tested on Ubuntu 14.04 LTS.
Features still in development.
No known bugs at this time.
Ty Kevan for help with the README

Author

About

A printing function that prints more than just f


Languages

Language:C 100.0%