https://github.com/izenynn/ft_printf
42 Cursus - ft_printf: A simple implementation of C printf function to add it to the libft and use it in future projects.
https://github.com/izenynn/ft_printf
42 42born2code c lib libc libft libft42 library linux macos printf printf-42
Last synced: 11 months ago
JSON representation
42 Cursus - ft_printf: A simple implementation of C printf function to add it to the libft and use it in future projects.
- Host: GitHub
- URL: https://github.com/izenynn/ft_printf
- Owner: izenynn
- License: gpl-3.0
- Created: 2021-09-24T10:06:58.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-21T21:01:51.000Z (almost 4 years ago)
- Last Synced: 2025-01-22T05:15:35.256Z (about 1 year ago)
- Topics: 42, 42born2code, c, lib, libc, libft, libft42, library, linux, macos, printf, printf-42
- Language: C
- Homepage:
- Size: 76.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 42 Cursus - ft_printf
## Info
A simple implementation of C printf function to add it to the libft and use it in future projects.
- Status: finished
- Result: 125%
- Observations: (null)
## Flags
- `%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) with lowercase.
- `%X` print a number in hexadecimal (base 16) with uppercase.
- `%%` print a percent sign.
- `-` left-justify within the given field width; Right justification is the default.
- `0` left-pads the number with zeroes (0) instead of spaces when padding is specified.
- `.` the precision in not specified in the format string, but as an additional integer value argument preceding the argument that has to be formated.
- `#` used with x or X specifiers the value is preceeded with 0x or 0X respectively for the values different than zero.
- `(space)` if no sign is going to be written, a blank space is inserted before the value.
- `+` forces to preceed the result with a plus or minus sign (+ or -) even for positive numbers. By default, only negative numbers are preceded with a - sign.
## How to use
If you want to try it yourself, check my libft repo, libft is a lib I made by myself and contains some useful C functions to use it in 42 projects, including ft_printf.
I explain how to use it in the README.md of the repo.
[Link to libft repo](https://github.com/izenynn/libft)
## P.S.
This project is estimated that it takes about 175 hours, and I do it in less than a day because I accidentally set a deadline, so please be gentile with my code :")
##
[](https://forthebadge.com)
[](https://forthebadge.com)