Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khammerschmidt/42cursus-ft_printf
Recoding the libc's printf function in C.
https://github.com/khammerschmidt/42cursus-ft_printf
complexity variadic-arguments
Last synced: about 1 month ago
JSON representation
Recoding the libc's printf function in C.
- Host: GitHub
- URL: https://github.com/khammerschmidt/42cursus-ft_printf
- Owner: KHammerschmidt
- Created: 2021-10-15T05:39:15.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T20:55:46.000Z (about 2 years ago)
- Last Synced: 2024-03-14T21:04:02.921Z (9 months ago)
- Topics: complexity, variadic-arguments
- Language: C
- Homepage:
- Size: 446 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
π§° ft_printf
Printing output with format specifiers by using variadic arguments
Start date: 05/august/2021
Project status: completed 100/100 points
---
## π‘ About the project
> The aim of this project is to re-code ``` libc ```'s printf function with the conversions:
' c ', ' s ', ' p ', ' d ', ' i ', ' u ', ' x ', ' X ' and ' % '.**Requirements**
β’ The function has to handle the following conversions: cspdiuxX%
β’ The function will be compared against the original printf()
β’ To create the library command ar must be used
β’ Donβt implement the buffer management of the original printf()
β’ Using the libtool command is forbidden
β’ Executable libftprintf.a has to be created at the root of your repository**Key learning points**
- Handling variadic arguments
- Organising a complex project with various sub-functions & libraries in sub-directories## π Format specifiers explained
| Specifier | Meaning |
| ----------|-----------------------------------------------------------------------|
| * [`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 |## π οΈ **Usage**
Clone the repository:
```bash
git clone https://github.com/KHammerschmidt/42cursus-ft_printf &&
cd ft_printf &&
git clone https://github.com/KHammerschmidt/42cursus-Libft
```To create library libftprintf.a:
Create the library archive:
```bash
make
```