Skip to content

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

License

Notifications You must be signed in to change notification settings

RogerioLS/Ft_Printf-42sp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📋 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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published