Git Product home page Git Product logo

my_printf's Introduction

my_printf

{EPITECH.} first year project.

Recoding libc's printf() & dprintf() functions, as well as a my_exit() function.

Requirements

Get started

Compile the library

Navigate to the root of the repository from your Terminal and run make to build the libmy.a static library.

Use my_printf

  • Copy this repository inside a folder in your project directory.
  • Include the my.h header file in your .c files where you want to use my_printf:
#include "my.h"
  • If you put this repository in a folder named lib/, run this command to compile a main.c file using the library:
gcc main.c -L lib/ -l my -I lib/include/

Functions

Here is a list of the functions you will find in the libmy.a library:

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

This function has the same behavior as libc's printf().

int     my_dprintf(int fd, const char *format, ...);

This function has the same behavior as libc's dprintf().

void    my_exit(int exit_code, const char *format, ...);

This function has the same behavior as libc's printf(). Except it outputs on stderr & it takes an exit status as first argument. After my_exit() is done printing, it will call libc's exit() to quit your program with the exit status you gave as an argument.

my_printf's People

Contributors

ronanboiteau avatar

Watchers

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