Git Product home page Git Product logo

jos-felipe / ft_printf Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 57 KB

This project is pretty straightforward, you have to recode printf. You will learn what is and how to implement variadic functions. Once you validate it, you will reuse this function in your future projects.

Home Page: https://man7.org/linux/man-pages/man3/printf.3.html

License: MIT License

Makefile 14.31% C 85.69%
42printf 42projects printf-42 42cursus ft-printf

ft_printf's Introduction

printf

Write a library that contains ft_printf, a function that will mimic the real printf

Summary

The printf() function produces output according to a format as described below. It writes output to stdout - the standard output stream. The overall syntax of a conversion specification is:

       %[$][flags][width][.precision][length modifier]conversion

Mandatory part

A small description of the required conversion:

  • %c print a single character.
  • %s print a string of characters.
  • %p The void * pointer argument is printed in hexadecimal.
  • %d print a decimal (base 10) number.
  • %i print an integer in base 10.
  • %u print an unsigned decimal (base 10) number.
  • %x print a number in hexadecimal (base 16).
  • %X print a number in upper case hexadecimal (base 16).
  • %% print a percent sign.

Bonus part

Manage all the following flags:

Flag Description
# Prefix the string "0x" or "0X" for x and X conversions.
' ' Add a single space (' ') in the front of positive numeric conversions.
+ Add a plus sign ('+') in the front of positive numeric conversions

How to test

make && cc -w -o tester tester.c -L./ -lftprintf && ./tester

ft_printf's People

Contributors

jos-felipe avatar

Stargazers

 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.