-
Notifications
You must be signed in to change notification settings - Fork 2
/
man_3_printf
85 lines (69 loc) · 1.99 KB
/
man_3_printf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.TH man 3 "15 March 2020" "0.1" "_printf man page"
.SH NAME
.B _printf
- format and print data
.SH SYNOPSIS
#include "holberton.h"
int _printf(const char *format, ... );
.SH DESCRIPTION
.B Requirements
library "holberton.h" | function _putchar
.B Usage
Print ARGUMENT(s) according to FORMAT, or execute according to OPTION:
.SH FORMAT
%c print characters
%s print strings
%d print integers of max and min size of an int type
%i print integers of max and min size of an int type
%b print unsigned integer as binary (base 2)
%u print unsigned integer
%o print unsigned integer as octal (base 8)
%x print unsigned integer as hexadecimal (base 16) lower case
%X print unsigned integer as hexadecimal (base 16) upper case
%p print address as hexadecimal (base 16) lower case
%S print strings including Non printable characters (ASCII code value hexadecimal)
%r print reversed string
%R print a string in rot13
.SH OPTION
FORMAT controls the output as in C printf. Interpreted sequences are:
%% print single %
.SH EXAMPLE
.PP
#include "holberton.h"
/*
* main - test _printf
*
* Return: 0
*/
int main()
{
int test;
test = 5
ret = _printf("%s\\n", "Holberton");
_printf("%d\\n", test);
return (0);
}
/**
* Output
* Holberton
* 5
*/
.PP
Print the string "Example" | _printf("%s", "Example");
print the singular character 'e' | _printf("%c", e);
Print the decimal number 5 | _printf("%d", 5);
Print the int number -98 | _printf("%i", -98);
.SH RETURN VALUES
On success returns an integer number of symbols printed
not counting \\0 for the string.
On failure returns error number (-1).
.SH NOTE
This project follows the C coding style for Holberton School. (Betty)
.SH SEE ALSO
.I printf(3)
.I write(2)
.I Betty(1)
.SH BUGS
21 Savage - a lot ft. J. Cole
.SH AUTHOR
Crispthofer Rincon Murrain, Santiago Efraín Martínez León