This repository holds all the code necessary for our custom
_printf
function to run. Our mini-version currently handles conversion specifiers:c
,s
,%
,d
,i
,b
,o
and does not yet support field width, precision, flag characters, or length modifiers. Unique to our _printf is ourr
reverse conversion and theR
rot13 conversion. In essence, you can print any character, string, integer, or decimal number, reverse your strings, transform any number to binary and octal bases, and encrypt your string with rot13 encryption.
man_3_printf ----------------------- custom manpage for custom _printf function
print.c ---------------------------- holds custom _printf function
holberton.h ------------------------ holds prototypes of functions spread across all files
getFunc_and_buffer_functions.c ----- holds functions to get appropriate function, and create and write buffer
strcpy.c --------------------------- holds custom-made strcpy function
strlen.c --------------------------- holds custom-made strlen function
string.c --------------------------- handles %s to print a string of characters
char.c ----------------------------- handles %c to print a single character
decimal.c -------------------------- handles %d and %i to print (d)ecimal/(i)ntegers in base 10
binary.c --------------------------- handles %b to convert numbers passed into base 2
octal.c ---------------------------- handles %o to convert numbers passed into base 8
rot13 ------------------------------ handles %R to move each character 13 alphabet letters down
- Language: C
- OS: Ubuntu 14.04 LTS
- Compiler: gcc 4.8.4
- Style guidelines: Betty style
(terminal)$ git clone https://github.com/MelissaN/printf.git
(terminal)$ cd printf
Sample main program inside print.c:
int main(void)
{
_printf("%s %c%drld", "Hello", "W", 0);
return (0);
}
====================================
(terminal)$ gcc -Wall -Werror -Wextra -pedantic -Wno-format *.c -o print
(terminal)$ ./print
Hello W0rld
(terminal)$
- The main _printf function can be separated into more modular shorter functions
- More functionality can still be added (e.g. support field width specifiers, etc)