https://github.com/jotavare/ft_printf
Redo the behavior of C library function printf without using it.
https://github.com/jotavare/ft_printf
c flags ft-printf gdb makefile norminette recursion static-library string-manipulation structures valgrind valist variadic-arguments write
Last synced: 10 months ago
JSON representation
Redo the behavior of C library function printf without using it.
- Host: GitHub
- URL: https://github.com/jotavare/ft_printf
- Owner: jotavare
- License: mit
- Created: 2022-12-30T20:43:03.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-06-26T23:04:19.000Z (over 1 year ago)
- Last Synced: 2024-06-27T02:46:58.190Z (over 1 year ago)
- Topics: c, flags, ft-printf, gdb, makefile, norminette, recursion, static-library, string-manipulation, structures, valgrind, valist, variadic-arguments, write
- Language: C
- Homepage:
- Size: 1.29 MB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
About •
How to use •
Mandatory •
Bonus •
Norminette •
Contributing •
License
## ABOUT
This project involved recreating the well-known C library function, printf. This provided a valuable learning opportunity in variadic arguments and structures, particularly if we intend to incorporate additional flags into our implementation of print.
- [Subject](https://github.com/jotavare/ft_printf/blob/master/subject/en_subject_ft_printf.pdf) `PDF`
- [References](https://github.com/jotavare/42-resources#01-ft_printf) `GitHub`
## HOW TO USE
#### 1º - Clone the repository
```git
git clone git@github.com:jotavare/ft_printf.git
```
#### 2º - Enter the project folder and run `make`
```bash
cd ft_printf/ft_printf
make
```
#### 3º - To use in your code, include the header
```c
#include "ft_printf.h"
```
#### MAKEFILE RULES
`make` or `make all` - Compile ft_printf files.
`make clean` - Delete all .o (object files) files.
`make fclean` - Delete all .o (object files) and .a (executable) files.
`make re` - Use rules `fclean` + `all`.
## MANDATORY
> This ft_printf function supports several format specifiers, described below:
- [x] `%c` - Print a single character;
- [x] `%s` - Print a string;
- [x] `%p` - Print void * pointer argument in hexadecimal format;
- [x] `%d` - Print a decimal (base 10) number;
- [x] `%i` - Print an integer in base 10;
- [x] `%u` - Prints an unsigned decimal (base 10) number;
- [x] `%x` - Print a number in hexadecimal (base 16) lowercase format;
- [x] `%X` - Print a number in hexadecimal (base 16) uppercase format;
- [x] `%%` - Print a percentage sign;
## BONUS
- [ ] Manage any combination of the following flags: `-O` and the field minimum width under all conversions;
- [ ] Manage all the following flags: `#` ` ` `+`;
## NORMINETTE
> At 42 School, it is expected that almost every project is written following the Norm, which is the coding standard of the school.
```
- No for, do...while, switch, case, goto, ternary operators, or variable-length arrays allowed;
- Each function must be a maximum of 25 lines, not counting the function's curly brackets;
- Each line must be at most 80 columns wide, with comments included;
- A function can take 4 named parameters maximum;
- No assigns and declarations in the same line (unless static);
- You can't declare more than 5 variables per function;
- ...
```
* [42 Norms](https://github.com/42School/norminette/blob/master/pdf/en.norm.pdf) - Information about 42 code norms. `PDF`
* [Norminette](https://github.com/42School/norminette) - Tool to respect the code norm, made by 42. `GitHub`
* [42 Header](https://github.com/42Paris/42header) - 42 header for Vim. `GitHub`
## CONTRIBUTING
If you find any issues or have suggestions for improvements, feel free to fork the repository and open an issue or submit a pull request.
## LICENSE
This project is available under the MIT License. For further details, please refer to the [LICENSE](https://github.com/jotavare/ft_printf/blob/master/LICENSE) file.