printing data in the stdout
This Function : is used to print formatted output in numerous ways to the standard output stdout.
The function is written in C language and thus needs the gcc
compiler and some standard C libraries.
1. To use the function in your code, simply include a main() with its header:
#include "ft_printf.h"
int main()
{
ft_printf("%s\n", "hello world");
return (0);
}
Simply run this command (change X with the file of the main function):
make && gcc X
As a
bonus
to the Mandatory requirement, the function should :
- Manage any combination of the following flags: ’-0.’ and the field minimum width under all conversions.
- Manage all the following flags: ’# +’ (Yes, one of them is a space)
#include <stdio.h>
int main()
{
printf("%-7d\n", 1337);
printf("%07s\n", "1337");
printf("%+7d\n", 1337);
return 0;
}
./a.out | cat -e
1337 $
0001337$
+1337$