GithubHelp home page GithubHelp logo

psprawka / ft_printf Goto Github PK

View Code? Open in Web Editor NEW
4.0 0.0 1.0 203 KB

Because I'm bored of using ft_putstr :sunglasses:

License: MIT License

Makefile 2.74% C 97.26%
c 42 static-library library ft-printf printf

ft_printf's Introduction

Ft_printf - recreating printf functionality ⚙️

Because I'm bored of ft_putstr 😎 Actually, no. I was just not allowed to use printf in my school projects, so I recoded my own. This project covers implementation of a C laguage feature – variadic functions. It also includes practice detailed management of the printing options via dispatch tables (which I unfortunately did not implement in this project when I was a beginner - I know, shame on me 😳).

Ft_printf argument prototype & features I handle:

Argument prototype: %[flags][width/margin][.precision][hh|h|l|ll|j|z]type, where:

  • flags: + || - || || # || 0;
  • width/margin:
    • min amount of displayed digits, does not cut digits if less, fill with spaces on the left side;
    • if * added it's necessary to pass one more parameter with a number of spaces before the actual parameter;
  • .precision:
    • for diouxX min amount of digits, fill with 0 is necessary;
    • for eEf amount of digits after dot;
    • for gG amount of all digits, if bigger displays number;
    • for sS max amount of characters;
    • if * added is necessary to pass one more parameter with a number of spaces before the actual parameter;
  • [hh|h|l|ll|j|z|q]: default values' modification:
    • hh: for idouxX - char;
    • h: for idouxX - short int;
    • l: for idouxX - long int, for feE - double;
    • ll: for idouxX - long long int;
    • j: for idouxX - intmax_t;
    • z: for idouxX - size_t;
    • q: for CS - prints Unicode

How to run ft_printf?

Copy and paste to your terminal following text:

git clone https://github.com/psprawka/Ft_printf.git 42SV_ft_printf
cd 42SV_ft_printf
make

This will create a static library - libftprintf.a - which you just need to include to the project that you need ft_printf in. 🔧

My grade for ft_printf project:

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.