https://github.com/rogeriols/ft_printf-42sp
This project consists of coding a library that contains a simplified version of the printf function.
https://github.com/rogeriols/ft_printf-42sp
42 42-projects printf printf-42 school42
Last synced: about 1 year ago
JSON representation
This project consists of coding a library that contains a simplified version of the printf function.
- Host: GitHub
- URL: https://github.com/rogeriols/ft_printf-42sp
- Owner: RogerioLS
- License: mit
- Created: 2023-09-17T18:14:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-28T17:27:45.000Z (over 2 years ago)
- Last Synced: 2025-02-13T14:53:35.754Z (over 1 year ago)
- Topics: 42, 42-projects, printf, printf-42, school42
- Language: C
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :clipboard: Printf | 42 SP












---

- 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
``` shell
$> git clone https://github.com/RogerioLS/Ft_Printf-42sp
$> cd Ft_Printf-42sp
$> make
```
In your code, simply include its header:
``` C
#include "libftprintf.h"
```
And, when compiling your code, add the required flags:
``` shell
$> make && cc -w -o your_file your_file.c -L./ -lftprintf && ./your_file
```