Coder Social home page Coder Social logo

printf's Introduction

0x11 -> Printf


Typing SVG

Description

printf is a weel known function used in C programming to do formated printing. Usually it only takes the standard library to call it into a c program, and using it for simple strings or formatted specifiers that allow us to print diferent types of data. This time we are presenting a printf project made from scratch in most of its features in order to understand the complexity of a powerful tool. You can see man 3 of printf to understand how _printf works.

Compilation

$ gcc -Wall -Werror -Wextra -pedantic *.c

Prototype

int _printf(const char *format, ...)

Return

If everything is succesful the function returns the number of characteres printed.

Formats

Specifiers Description
%c Print Single character
%s Print String of characteres
%S Print Non printable characters as (\x)
%d Print Decimal numbers
%i Print Integers
%p Print Adresse
%b Print Binary
%u Print Unsigned int
%o Print Octal
%x Print Hexadecimal (lower case)
%X Print Hexadecimal (upper case)
%+ Print Integer followed by plus signe if positive (flag)
%# Print 0 for octal, print (0x, 0X) for hexadecimal (flag)
%r Print The reversed string
%R Print The rot13'ed string

Printf Project

This project is an implementation of the printf function in the C programming language.
The printf function is used to print formatted output to the standard output stream.

Typing SVG

printf's People

Contributors

achux21 avatar aadelaferyad 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.