You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-16Lines changed: 42 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,45 +62,66 @@
62
62
</header>
63
63
64
64
65
-
A custom implementation of the C standard library's `printf` function. This project is part of the 42 school curriculum and aims to replicate the original `printf` behavior, including handling various format specifiers, flags, and arguments.
65
+
A custom implementation of the C standard library's `printf` function. This project is part of the 42 school curriculum and recodes the original `printf` behavior, providing a lightweight and portable way to format and print data.
66
66
67
67
## Features
68
68
69
-
-**Handles standard format specifiers**: `c`, `s`, `p`, `d`, `i`, `u`, `x`, `X`, and `%%`.
70
-
-**Implements bonus flags**: `-` (left-justify), `0` (zero-padding), `.` (precision), and `#` (alternate form for `x`/`X`).
71
-
-**Supports field width**: Controls the minimum number of characters printed, including dynamic width using `*`.
69
+
This implementation of `ft_printf` supports the following format specifiers, flags, and features:
70
+
71
+
#### Conversion Specifiers
72
+
73
+
| Specifier | Output |
74
+
| :---: | --- |
75
+
|`%c`| A single character. |
76
+
|`%s`| A string of characters. |
77
+
|`%p`| The memory address of a pointer, in hexadecimal format. |
78
+
|`%d`| A signed decimal integer. |
79
+
|`%i`| A signed decimal integer. |
80
+
|`%u`| An unsigned decimal integer. |
81
+
|`%x`| An unsigned hexadecimal integer (lowercase). |
82
+
|`%X`| An unsigned hexadecimal integer (uppercase). |
83
+
|`%%`| A literal percent sign (`%`). |
84
+
85
+
#### Flags and Modifiers
86
+
87
+
-**`-`**: Left-justify the output within the field width.
88
+
-**`0`**: Zero-pad the output instead of using spaces.
89
+
-**`.`**: Specifies precision for strings and integers.
90
+
-**`#`**: Alternate form; prepends `0x` or `0X` for hexadecimal conversions.
91
+
-**Width**: Specifies a minimum field width for the output.
92
+
-**`*`**: Use the next argument as the field width.
0 commit comments