GithubHelp home page GithubHelp logo

almayor / ft_printf Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5.77 MB

Re-implementing printf with a spin

License: MIT License

Makefile 1.90% C 74.80% C++ 23.30%
c variadic-function dispatcher printf-42 42projects 42 21school ft-printf

ft_printf's Introduction

ft_printf

This project is part of the official curriculum at School 42.

Disclaimer

In School 42, almost every project must be written to comply with. coding standard (also known as the "Norm"). As a result, the implementation of certain parts may appear strange.

Overview

  • Official instructions
  • Module documentation
  • The goal of this project is to practice the following concepts
    • variadic functions
    • dispatch tables – loose coupling and performance
    • void pointers – generic programming
    • optimization patterns – buffering
  • Only the following functions are allowed
    • write
    • malloc
    • free
    • exit
    • functions of stdarg
  • The project (with the exception of tests) is consistent with the Norme, the code standard accepted at School 42. In particular, this means that
    • no comments inline or inside functions
    • for loops and switch statements are forbidden
    • each function must be maximum 25 lines
    • no functional macros
  • As per instructions, the project is realised using libft written in a previous project.

Checklist

Standard

  • csp% conversions
  • diouxX conversions with hh, h, l, ll flags
  • f conversion with flags L, l
  • #0-+ flag management (when applicable)
  • minimum field-width
  • precision
  • * flag management

Extra

  • b conversion to print in binary
  • variants of printf
    • ft_dprintf
    • ft_vprintf
    • ft_vdprintf
    • ft_sprintf
    • ft_snprintf
    • ft_vsprintf
    • ft_vsnprintf
    • ft_asprintf
    • ft_vasprintf
  • colors
    • ft_printf("{red} Color-print.{eoc} Normal print.")
    • red, blue, yellow, green, cyan, magenta

Tests

Run tests with make test

  • Behaviour is tested with Unity
  • Performance is benchmarked against printf(3)

Acknowledgements

Many of the included tests are borrowed from pft by gavinfielder and other contributors and Moulitest by yyang42 and other contributors. My thanks go to them.


If you have any questions, please contact me on Github.

ft_printf's People

Contributors

almayor avatar

Watchers

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