Giter Club home page Giter Club logo

42hive-ft_printf's Introduction

42Hive-ft_printf

Disclaimer

At Hive Helsinki, a 42 Network school, students must write projects according to the "norme". Many formats are restricted, so the code may look surprising in some places.

About

The built-in C Library functions we are allowed to use for almost all of our projects are highly limited. Generally, we can only use the following:

  • write
  • malloc
  • free
  • exit

With such limited resources available, we must recode much of our own libraries. In particular, it's time we made our printf, which has an undeniable utility to a coder.

The versatility of the printf function in C represents a great exercise in programming for us. This project is of moderate difficulty. It will enable you to discover variadic functions in C in a particularly relevant context as well as learn about a great example of a basic “dispatcher” in C via the use of an array of function’s pointers.

Description

printf is prototyped as:

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

where format is a character string, and is composed of zero or more directives. The directives specify how subsequent optional arguments are converted for output.

The directives are: ordinary characters (not %), which are copied unchanged to the output stream; and conversion specifications, each of which results in fetching zero or more subsequent arguments.

The conversion specification is introduced with the character %, and ends with a conversion specifier. In between, there may be (in this order) zero or more flags, an optional minimum field width, an optional precision and an optional length modifier. The overall syntax is:

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

42hive-ft_printf's People

Contributors

caruychen avatar

Watchers

 avatar

Forkers

maxrantil

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.