Giter Club home page Giter Club logo

printf's Introduction

_printf

A formatted output conversion C program. It is a pseudo-recreation of the C standard library function printf

Synopsis

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

Dependencies

All files will be complied on Ubuntu 20.04LTS using gcc, using the options gcc -Wall -Werror -Wextra -pedantic -Wno-format -std=gnu89 *.c

Usage

After complilation, _printf() is ready for use.

Example main.c:

    include "printf.h"

    int main(void)
    {
         _printf("This is an implementation of %s\n", "printf");
    }

Complilation:

    gcc -Wall -Werror -Wextra -pedantic -Wno-format -std=gnu89 *.c -o tester

Output:

    $ ./tester
    This is an implementation of printf
    $

Description

The _printf() function produces output in accordance to a specified format. This function prints its output to the stdout and returns the length of the output when successful.

Conversion Specifiers

  • %c: Character specifier
  • %d: Decimal specifier
  • %i: Integer specifier
  • %s: String specifier (character pointer)
  • %%: Print the percentage sign
  • %o: Octal specifier
  • %x: Hexadecimal specifier
  • %X: Hexadecimal specifier (Uppercase)
  • %p: Address specifier

Custom Specifiers

  • %b: Binary specifier
  • %R: rot13'ed specifier
  • %r: reversed specifier
  • %S: String specifier. (Non printable characters (0 < ASCII value < 32 or >= 127) are printed this way: \x, followed by the ASCII code value in hexadecimal (upper case - always 2 characters))

Author

Acknowledgments

This project was written as part of the curriculum for Holberton/ALX-SE program

printf's People

Contributors

3akare avatar

Stargazers

Roman avatar

Watchers

 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.