Git Product home page Git Product logo

ft_printf's Introduction

42cursus' ft_printf

Development repo for 42cursus' ft_printf project
For further information about 42cursus and its projects, please refer to 42cursus repo.


🗣️ About

This project is pretty straight forward. You will recode printf. Hopefully you will be able to reuse it in future project without the fear of being flagged as a cheater. You will mainly learn how to use variadic arguments.

🚀 TLDR: this project consists of coding a library that contains a simplified version (more
information below) of the printf function.

Mandatory

  • format specifiers - cspdiuxX%

🛠️ Usage

Requirements

The library is written in C language and thus needs the gcc compiler and some standard C libraries to run.

Instructions

1. Compiling the library

To compile the library, run:

$ cd path/to/ft_printf && make

2. Using it in your code

To use the library functions in your code, simply include its header:

#include "ft_printf.h"

and, when compiling your code, add the required flags:

-lftprintf -L path/to/libftprintf.a -I path/to/ft_printf.h

Third-party testers

📌 Useful Links

Notes

  1. What is Variadic Functions?
    • Variadic function takes indefinite size arity and a variable number of arguments as a parameter. Situations that you do not know how many parameters pass the function.
  2. what is ellipses (...)?
    • The ellipsis (...) is part of the C language and indicates that there are 0 or more optional arguments.
  3. What is va_list?

  4. What is va_start?
    • gets the address of the first argument.
  5. What is va_arg?
    • dereference the block address and type cast it to the appropriate type. then goes to the next block of memory.
    • What is a "Type Descriptor"?
  6. What is va_end?

  7. Calling convensions!

notes

  • man stdarg

ft_printf's People

Contributors

achrafelkhnissi avatar

Stargazers

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