Code Monkey home page Code Monkey logo

print's Introduction

_printf

enter image description here That is the prototype for this implementation(_printf). As you can see, this prototype is an implementation of the printf standard function and variadic function . ## What is printf? "Writes the C string pointed by format to the standard output (stdout)" - cplusplus

In other words, the function receives a format (const char *format) and a list of arguments (the magic of variadic functions). So printf inside, take the string format and search for specific patterns, then the pattern that was found it is passed to other function that prints the match pattern

Patterns

enter image description here cplusplus

That image shows specifiers that we can use in the printf. In this case, _printf just allow specifiers like

Specifiers Functions Description
s print_string print a string
c print_char print just a char
i print_integer print a number in base 10
d print_integer print a number in base 10
p print_pointer print a memory address in base 16 lowercase
b print_binary print a number in base 2
x print_hexadecimal_low print a number in base 16 lowercase
X print_hexadecimal_upp print a number in base 16 uppercase
o print_octal print a number in base 8
R print_rot print a string encoded in rot13 format

Flowcharts

These 3 functions are the bases for this project:

  1. Printf: Is the frontend of all the algorithm, so is the prototype, and just receive the variables
  2. Handler: Is the controller for the string and the formats, and also does the counter for the numbers of bytes that are printing
  3. Percent handler: Compare a list of possible specifiers with the current pattern, and return the corresponding function

enter image description here enter image description here enter image description here

Contributors

@Jose Parrales - Github - @David Orozco - Github

print's People

Contributors

amanwho101 avatar

Watchers

YaredT21 avatar

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.