Code Monkey home page Code Monkey logo

printf's Introduction

Printf

Implementing C's printf function

Description

This printf project replicates the main features of c's printf function. It sends a formated string to thestandard output. The output is written under the control of a format string that specifies how the subsequent arguments are processed for output.

The format string is composed of zero or more directives: ordinary characters (not %), which are copied unchanged to the output stream; and conversion specifications, each of which results in fetching zero or more subsequent arguments. Each conversion specification is introduced by the character %, and ends with a conversion specifier. In between there may be (in this order) zero or more flags, an optional minimum field width, an optional precision and an optional length modifier.

Functionalities

This function covers the following functionalities

  • Printing Strings
  • Printing Characters
  • Printing Numbers

The format specifiers %s, %c, %i, %d are used to provide this functionalities respectively

Usage Examples

Functionaity Specifier Example Output
Print String %s _printf("Print a %s, "string") Print a string
Print Character %c _printf("Print a character %c, 'A') Print a character A
Print Number %d _printf("Print number %d, 12) Print number 12
Print Number %i _printf("Print number %i, 12) Print number 12

The specifiers can also be used in combination as shown below
_printf("Print a %s and the integer %d, "string", 100) outputs Print a string and the integer 100

Contributors

There are two contributors to this repository
Gadisa Asfaw | Rediet Tadesse

printf's People

Contributors

reid-t-w avatar gadisaasfaw avatar

Watchers

James Cloos avatar  avatar

Forkers

reid-t-w

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.