Welcome to our team project, Printf, where we will be creating a custom formatting function for producing output according to a specified format. This project aims to simulate the behavior of the standard C library's printf
function while also handling some custom conversion specifiers. We are dedicated to delivering a reliable and efficient solution for printing formatted output in C.
"I'm not going anywhere. You can print that wherever you want to. I'm here and I'm a Spur for life." - Team Printf
Our custom printf
function will be able to handle the following conversion specifiers:
- %d: Print signed decimal integer
- %i: Print signed decimal integer
- %u: Print unsigned decimal integer
- %o: Print unsigned octal (base 8) number
- %x: Print unsigned hexadecimal (base 16) number (lowercase)
- %X: Print unsigned hexadecimal (base 16) number (uppercase)
- %p: Print pointer address
In addition to the standard conversion specifiers, our custom printf
function will also handle the following custom conversion specifiers:
- %r: Print a string in reverse
- %R: Print the Rot13 encoding of a string
- %w: Print the string with alternating uppercase and lowercase characters
- %s: Print the string, replacing spaces with underscores
- %S: Print the string, replacing spaces with asterisks
To minimize the number of calls to the system's write
function, we will utilize a local buffer of 1024 characters in our implementation.
Our custom printf
function will support the following features:
- Field Width: Allowing the user to specify the minimum width for the output.
- Precision: Providing the ability to set the precision for floating-point numbers.
- Flag Characters: Handling flag characters like
0
and-
for alignment purposes.
We believe that education and experience go hand in hand. As a team, we are committed to working together, sharing knowledge, and supporting each other to create a powerful and efficient custom printf
function.
With the combined effort of our team, we are confident that our custom printf
function will be a success and serve as a valuable tool for handling formatted output in C. Let's embark on this journey together and make printing in C a smoother and more enjoyable experience.
"Print some money and give it to us for the rain forests." - Team Printf