GithubHelp home page GithubHelp logo

printf's Introduction

_printf

_printf is a simple custom printf function that formats and prints data to the standard output.

Description

_printf() functiion formats and prints data to the standard output according to the format specified.

The function has the following conversion specifies:

  • %c - prints a character
  • %d - prints a integer
  • %s - prints a string
  • %i - prints an integer
  • % - prints percentage;
  • %b - print binary numbers
  • %u - print unsigned integers of type int
  • %x - print hexadecimal numbers in lowercase
  • %X - print hexadecimal numbers in uppercase
  • %o - print octal numbers
  • %r - prints string in reverse order
  • %R - prints string in ROT13 encoding
  • %p - print pointer addresses
  • ' ' - print a space
  • - modifier for unsigned conversions

  • +: prints a plus sign in front of the number

Installation

you can clone this repository and use the function on your local machine.

git clone https://github.com/Abinet508/printf.git

Usage

  • include the main.h header file on the function for using _printf().
  • All the files are to be compiled on Ubuntu 14.04 LTS
Compile your code with `gcc -Wall -Werror -Wextra -pedantic *.c`
#include <stdio.h>
#include "main.h"

int main(void)
{
    int i = 10;
    int print;
    char *s = "printf by Teddy & Mark";
    _printf("%d %s %c\n", i, s, 'c');
     print =  _printf("%d", s); /* get number of characters */
     printf("%d\n", print); /* print number of characters */
    return 0;
}

printf's People

Contributors

absobk02 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.