https://github.com/mathyscogne/42_ft_printf
Because ft_putnbr and ft_putstr aren’t enough. Custom printf function for 42.
https://github.com/mathyscogne/42_ft_printf
42 ftprintf
Last synced: 5 months ago
JSON representation
Because ft_putnbr and ft_putstr aren’t enough. Custom printf function for 42.
- Host: GitHub
- URL: https://github.com/mathyscogne/42_ft_printf
- Owner: MathysCogne
- Created: 2024-10-21T19:04:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-26T12:39:36.000Z (about 1 year ago)
- Last Synced: 2025-04-03T14:11:39.440Z (10 months ago)
- Topics: 42, ftprintf
- Language: C
- Homepage:
- Size: 1.45 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Features
- This project is a custom implementation of the `printf` function in C
- Handles specifiers: `%c`, `%s`, `%d`, `%i`, `%u`, `%x`, `%X`, `%p`, and `%%`.
| Specifier | Description | Base |
:-----------|:-------------------|:-------------
| **`%c`** | Single character | -- |
| **`%s`** | String | -- |
| **`%d`** | Decimal number | Decimal |
| **`%i`** | Integer | Decimal |
| **`%u`** | Unsigned Integer | Decimal |
| **`%x`** | Lowercase number | Hexadecimal |
| **`%X`** | Uppercase number | Hexadecimal |
| **`%p`** | Pointer - Memory addr | Hexadecimal |
| **`%%`** | Percent sign | -- |
## Project Structure
- **includes/**
- [`ft_printf.h`](./includes/ft_printf.h) - Header file
- **srcs/**
- [`ft_printf.c`](./srcs/ft_printf.c) - ft_printf
- [`ft_putlstr.c`](./srcs/ft_putlstr.c) - Prints strings
- [`ft_putlnbr.c`](./srcs/ft_putlnbr.c) - Prints integers
- [`ft_putlunbr_base.c`](./srcs/ft_putlunbr_base.c) - Prints unsigned numbers in different bases
- [`ft_putladdr_base.c`](./srcs/ft_putladdr_base.c) - Prints memory addresses
- [`ft_utils.c`](./srcs/ft_utils.c) - Utility functions
- [`test.c`](./srcs/test.c) - Test file / Main
- **Makefile**
- [`Makefile`](./Makefile): Compilation rules
- **subject/**
- [`printf_en.pdf`](./subject/printf_en.pdf) - Subject En
- [`printf_fr.pdf`](./subject/printf_fr.pdf) - Subject Fr
## Compilation `libftprintf.a`
To compile the library, simply run the `make` command:
```bash
make
```
``make bonus``
``make clean``
``make fclean``
``make re``
## Disclaimer
> At 42 School, most projects must comply with the [Norm](https://github.com/42School/norminette/blob/master/pdf/en.norm.pdf).