https://github.com/jos-felipe/ft_printf
This project is pretty straightforward, you have to recode printf. You will learn what is and how to implement variadic functions. Once you validate it, you will reuse this function in your future projects.
https://github.com/jos-felipe/ft_printf
42cursus 42printf 42projects ft-printf printf-42
Last synced: 3 months ago
JSON representation
This project is pretty straightforward, you have to recode printf. You will learn what is and how to implement variadic functions. Once you validate it, you will reuse this function in your future projects.
- Host: GitHub
- URL: https://github.com/jos-felipe/ft_printf
- Owner: jos-felipe
- License: mit
- Created: 2023-08-23T14:11:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-11T19:02:34.000Z (over 2 years ago)
- Last Synced: 2025-03-09T03:51:15.553Z (about 1 year ago)
- Topics: 42cursus, 42printf, 42projects, ft-printf, printf-42
- Language: C
- Homepage: https://man7.org/linux/man-pages/man3/printf.3.html
- Size: 55.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# printf
Write a library that contains ft_printf, a function
that will mimic the real printf
## Summary
The printf() function produces output according to a format as described below.
It writes output to stdout - the standard output stream. The overall syntax of a conversion specification is:
%[$][flags][width][.precision][length modifier]conversion
### Mandatory part
> A small description of the required conversion:
>
> - `%c` print a single character.
> - `%s` print a string of characters.
> - `%p` The void * pointer argument is printed in hexadecimal.
> - `%d` print a decimal (base 10) number.
> - `%i` print an integer in base 10.
> - `%u` print an unsigned decimal (base 10) number.
> - `%x` print a number in hexadecimal (base 16).
> - `%X` print a number in upper case hexadecimal (base 16).
> - `%%` print a percent sign.
### Bonus part
Manage all the following flags:
| Flag | Description |
|-------|-----------------------------------------------------------------------------------|
| **#** | Prefix the string "0x" or "0X" for x and X conversions. |
|**' '**| Add a single space (' ') in the front of positive numeric conversions. |
| **+** | Add a plus sign ('+') in the front of positive numeric conversions
### How to test
```shell
make && cc -w -o tester tester.c -L./ -lftprintf && ./tester
```