The goal of this collaboration project we are created a function called _printf
The function _printf
is used to print a character string and returns it to the terminal output
Prototype : int _printf(const char *format, ...);
c : character
s : string
% : percent sign
d : decimal number
i : integer
gcc -Wall -Wextra -Werror -pedantic -std=gnu89 -Wno-format *.c
All the files will be compiled on Ubuntu 20.04 LTS using gcc
All files that contain code use the Betty style
The header files : Main.h
Allowed editors : vi, vim, emacs
#include "main.h"
int main(void)
{
_printf("Hello, %s!\n", "everyone")
return (0)
}
output
Hello, everyone
#include "main.h"
int main(void)
{
_printf("Number: %d\n", 24)
return (0)
}
output
Number: 24
#include "main.h"
int main(void)
{
_printf("The character is: %c\n", 'A')
return (0)
}
Output
The character is: A
You can check the Man page of the function here.