-
Notifications
You must be signed in to change notification settings - Fork 1
/
man_3_printf
executable file
·52 lines (44 loc) · 1.9 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
.TH _printf 3 "06 17 2017" "1.0"
.SH NAME
_printf \- simple replication of printf function
.SH SYNOPSIS
.B #include "holberton.h"
.B int _printf(const char \fI*format\fR\fB, ...)\fR
.SH DESCRIPTION
\fB_printf()\fR produces output according to a \fformat\fR as described below. This function writes to \fIstdout\fR, the standard output stream, under the control of a format string that specifies how subsequent arguments (or arguments accessed via the variable-length argument facilities of \fBstdarg\fR(3)) are converted for output.
.SH RETURN VALUE
Upon successful return, these functions return the number of characters printed (excluding the null byte used to end output to strings).
.SH THE CONVERSION SPECIFIER
A character that specifies the type of conversion to be applied. The conversion specifiers and their meanings are:
.TP
\fBd\fR, \fBi\fR
The int argument is converted to signed decimal notation.
.TP
\fBc\fR
The int argument is converted to an unsigned char, and the resulting character is written.
.TP
\fBs\fR
The const char * argument is expected to be a pointer to an
array of character type (pointer to a string). Characters from the array are written up to(but not including) a terminating null byte ('\0').
.TP
\fB%\fR
A '%' is written. No argument is converted. The complete conversion specification is '%%'.
.TP
\fBo, u, x, X\fR
The unsigned int argument is converted to unsigned octal (o), unsigned decimal (u), or unsigned hexadecimal (x and X) notation. The letters abcdef are used for x conversions; the letters ABCDEF are used for X conversions.
.TP
\fBp\fR
The void * pointer argument is printed in hexadecimal
.TP
\fBb\fR
The unsigned int argument is converted to binary.
.SH SEE ALSO
.B printf(3)
.SH BUGS
No known bugs.
.SH EXAMPLE
To print the string "I love pie!":
#include "holberton.h"
_printf("%s\n", "I love pie!");
.SH AUTHOR
Minas Anton, Jennifer Huang.