The goal of this project is pretty straightforward. You will recode printf().
You will mainly learn about using a variable number of arguments. How cool is that??
It is actually pretty cool :)
- Version 10
Flag | Description | Implemented? |
---|---|---|
# |
Alternate form | ✅ |
0 |
Zero padding | ✅ |
- |
Left adjusted (right padded) | ✅ |
(space) | Blank sign for positive numbers | ✅ |
+ |
Force + sign for positive numbers |
✅ |
Specifier | Description | Implemented? |
---|---|---|
d , i |
Decimal int |
✅ |
o |
Octal unsigned int |
❌ |
u |
Decimal unsigned int |
✅ |
x , X |
Hexadecimal unsigned int |
✅ |
e , E |
double |
❌ |
f , F |
double |
❌ |
g , G |
double |
❌ |
a , A |
Hexadecimal double |
❌ |
c |
unsigned char character |
✅ |
s |
const char * string |
✅ |
p |
void * pointer |
✅ |
m |
errno (glibc extension) |
❌ |
% |
A % is written |
✅ |
- https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c
- https://www.lix.polytechnique.fr/~liberti/public/computing/prog/c/C/FUNCTIONS/format.html
- https://nullprogram.com/blog/2023/02/13/
- https://www.youtube.com/watch?v=vpB9hFX_L2Y
- https://www.youtube.com/watch?v=kxHN6ICgjgQ
- https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3096.pdf