-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathman_3_printf
More file actions
67 lines (67 loc) · 2.09 KB
/
man_3_printf
File metadata and controls
67 lines (67 loc) · 2.09 KB
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
.\" Manpage for _printf Function
.\" Contact [email protected] or [email protected].
.TH _printf 1 "29 October 2019" "1.0" "Manual for _printf"
.SH NAME
_printf \- custom formatted output conversion
.SH SYNOPSIS
.B #include \(dqholberton.h\(dq
.PP
.B int _printf (const char *
.I format
.B , ...)
.PP
.B int _printc (va_list
.I arg
.B )
.PP
.B int _prints (va_list
.I arg
.B)
.PP
.B int _printi (va_list
.I arg
.B )
.PP
.B int _printd (va_list
.I arg
.B )
.PP
.B int _putchar (char
.I c
.B )
.SH DESCRIPTION
.B The _printf function produces output according for the
.I format
.B , then writes to standard output stream.
.SS Return Value
.B Upon success, the function return the number of characters printed excluding the null byte used to end output to strings.
.SS Format of the format string
.B The format string is composed of zero or more directives: ordinary characters (not %) wich are copied to the output stream as they are and conversion specifica\
tions, wich fetch 0 or more argumennts. The conversion specification are marked by the character % and ends with a conversion specifier.
.PP
.B The arguments must correspond with the conversion specifiers, and they are used in the given order.
.SS The conversion specifiers
.B Characters preceded by the character % that specifie the type of convertion to be applied. The specifiers and their meanings are:
.TP
.B c
.B The argument is converted into an int then prints the character represented by that int (refer to ascii table).
.TP
.B s
.B A
.I char *
.B argument (string) is expected. The string is printed till the terminating null byte.
.TP
.B d, i
.B An int argument is expected, prints the argument that is received signed and in base 10.
.SH CONFORMING TO
.B Conforms to C89, this function was not tested for C99.
.SH BUGS
.R Code as _printf(foo); indicates a bug since it may contain %n wich can cause a security hole if the user is untrusted.
.SH EXAMPLE
.B To print an integer:
.IP
.B #include \(dqholberton.h\(dq
.br
.B _printf(\(dqinteger : %d\en\(dq, 98);
.SH AUTHOR
Oscar Stiven Gómez Toro [email protected] and Aiko Mi [email protected]