Giter Site home page Giter Site logo

rogeriols / ft_printf-42sp Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 18 KB

This project consists of coding a library that contains a simplified version of the printf function.

License: MIT License

Makefile 15.11% C 84.89%
42 42-projects printf printf-42 school42

ft_printf-42sp's Introduction

📋 Printf | 42 SP

Norminette Build Static Badge 42 São Paulo License Code size in bytes Top language Last commit Repo size Languages GitHub repo file count (file type) Discord


  • Actual Status : finished.

  • Result : Approved with 105 points by moulinette (the 42 tester) ✅

    Prinft is the third project at 42. The purpose of this project is to repeat the behavior of the printf function but we only deal with some cases.

We need to implement the following conversions:

• %c Prints a single character.
• %s Prints a string (as defined by the common C convention).
• %p The void * pointer argument has to be printed in hexadecimal format.
• %d Prints a decimal (base 10) number.
• %i Prints an integer in base 10.
• %u Prints an unsigned decimal (base 10) number.
• %x Prints a number in hexadecimal (base 16) lowercase format.
• %X Prints a number in hexadecimal (base 16) uppercase format.
• %% Prints a percent sign.

📝 Functions

Files Description
ft_printf.c Contains the principal function: the function who deal with the type of data. Also contains the function who checks if is a conversion to deal with and the functions to deal with char or strings
ft_printf.h  The header with functions libraries and prototypes.
ft_putchar.c  Write sigle character.
ft_puthex.c  Prints a number in hexadecimal (base 16) lowercase and uppercase format.
ft_putnbr.c  Outputs the number interger.
ft_putptr.c  Outputs the pointer adress 'ptr' in the standard output.
ft_putstr.c  Goes through the entire array until '\0', if it does not exist, returns null.
Makefile The automatizated compilator

🛠️ Usage

In order to use this static library in your project, you must download this repository into your pc and compile the library

$> git clone https://github.com/RogerioLS/Ft_Printf-42sp
$> cd Ft_Printf-42sp
$> make

In your code, simply include its header:

#include "libftprintf.h"

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

$> make && cc -w -o your_file your_file.c -L./ -lftprintf && ./your_file

ft_printf-42sp's People

Contributors

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