Giter VIP home page Giter VIP logo

printf's Introduction

Printf Function

_printf()


Synopsis

This version of printf recreates the standard printf function. It's built to have all of the same basic functionalities as printf in the standard library, with a few additional capabilities. Printf is a function that takes in a format string, prints it to the standard output, and acts on format specifiers to print their respective arguments.

Environment

This version of printf was built and tested in Vagrant virtual machine, on the Ubuntu 14.04 LTS.

Format Specifiers Data Type
%i, %d Prints a signed decimal value
%c Prints a character
%s Prints a string
%S Same as (s) but prints unprintables as hex codes (32 = \x20)
%o Prints a unsigned int in octal
%u Prints an unsigned int in decimal
%b Prints an unsigned int in binary
%x Prints an unsigned int in hexadecimal with abcdef
%X Prints an unsigned int in hexadecimal with ABCDEF
%r Prints a string in reverse
%R Prints an string after encoding in Rot13
%p Prints the address of a pointer in hexadecimal
%% Prints a modulo

How to Use

  1. Clone this repository into your git. It contains all of the necessary components to make printf fully functional.
  2. Include the "holberton.h" header file in the programs that you want to use printf with.
  3. Execute _printf() as you would with a printf() function. Type the string that you want printed within the parentheses enclosed in double quotes. For format specifiers type a '%' sign followed by the character corresponding to the format specifier that you want to implement. Follow your double quoted string with a comma, and then a list of args to be called in the place of the specifiers.

For example: "_printf("Hello %c", "World")"

Will produce a string into the output that says: "Hello World"

File descriptions


File Descriptions
_printf.c Executes _printf function
holberton.h Function protoypes & struct typef
helper.c Loops through struct and finds the correct format specifier
_putchar.c Holds the putchar function, as well as puts and printchar
printint.c All the functions to print integers
printstring.c All the nevessary functions for printing a string
_strlen.c Various basic functions (strlen, strcmp, strcpyrot13, printrot)
pointadd.c Functions to print the address of a pointer
decimalconvert.c Functions that convert decimals into other types of int
decimalconvert2.c More functions that convert decimals
print_special.c Miscellaneous cases for printing (modulo, reverse, unsigned ints, etc.)
README.md Summary of the program and instructions on how to use _printf

Authors

*Dimitrios Philliou* - [Github] (https://github.com/DimitriCat)
*Thomas Dumont* - [Github] (https://github.com/Vilyanare)

printf's People

Contributors

vilyanare avatar d1m1tr10s avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

d1m1tr10s

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.