A simple printf function built by Chidozie Ogwalu and Israel Adenuga for Alx software Engineering School.
Rebuild of the standard printf function in C. Our project required a function capable of printing with the %d, %c, %s, and %% specifiers to standard output. printf returns the number of characters printed (excluding the null byte at the end of strings). We were not asked to handle flag characters, field width, precision, or length.
Our team chose to add %x ,%X, %b, %o, %u, %r, %R, and %p formatting. We relied on the library we have been building at Alx as well as new concepts gathered during this project.
TYPE - OUTPUT
c - Single character
s - String of character
r - String in reverse
R - String in rot13
d - Integer in decimal
i - integer
% - Percent sign
x - Lowercase hex(loervase)
X - Uppercase hex (unsigned)
b - signed binary
o - signed octal
u - unsigned integer
p - pointer address
Character: printf("%c", A); Output:: A
String: printf("%s", This is a string.); Output: This is a string.
Integer: printf("%i", 5); Output: 5
_printf.c Own Printf Function Tha Performs Formatted Output Conversion And Print Data.
Header File Were All Prototypes Are Saved.
Pointer To A Function That Selects The Correct Function To Perform The Operation.
Function That Prints The Buffer.
Function That Concatenates The Buffer Characters.
Function That Writes The Character C To Stdout.
/* Indetifier : %c */
Function That Writes The String To Stdout.
/* Indetifier : %s */
Function That Prints An Integer.
/* Indetifier : %i or %d */
Function That Prints Decimal In Binary.
/* Indetifier : %b */
Function That Prints Decimal In Octal.
/* Indetifier : %o */
Function That Prints Decimal In Hexadecimal.
/* Indetifier : %x */
Function That Prints Decimal In Uppercase Hexadecimal.
/* Indetifier : %X */
Function That Prints A String And Values Of Non-Printed Chars.
/* Indetifier : %S */
Function That Prints An Unsigned Integer.
/* Indetifier : %u */
Function That Writes The String To Stdout In Reverse.
/* Indetifier : %r */
Function That Writes The String To Stdout In Rot13.
/* Indetifier : %R */
Function That Prints The Address Of An Input Variable.
/* Indetifier : %p */
Function That Prints Long Decimal Number In Octal.
/* Indetifier : %lo */
Function That Prints Long Decimal Number In Hexadecimal.
/* Indetifier : %lx */
Function That Prints A Long Integer.
/* Indetifier : %li */
Function That Prints A Long Decimal In Uppercase Hexadecimal.
/* Indetifier : %lX */
Function That Prints A Long Unsigned Integer.
/* Indetifier : %lu */
Function That Prints Short Decimal Number In Octal.
/* Indetifier : %ho */
Function That Prints Short Decimal Number In Hexadecimal.
/* Indetifier : %hx */
Function That Prints A Short Integer.
Function That Prints A Short Decimal In Uppercase Hexadecimal.
/* Indetifier : %hX */
Function That Prints A Short Unsigned Integer.
/* Indetifier : %hu */
Function That Print A Number In Hexadecimal Begining With 0 And x.
/* Indetifier : %#x */
Function That Prints A Number In Octal Begining With 0 And o.
/* Indetifier : %#o */
Function That Prints A Number In Uppercase Hexadecimal.
/* Indetifier : %#X */
Function That Prints An Integer With Plus Symbol.
/* Indetifier : %+i */
Function That Prints An Integer Begining With 0 And u.
/* Indetifier : % i */
Function That Returns The Amount Of Indetifiers.
Chidozie Ogwalu -@gentomamacine Israel Adenuga -@adexino0606