-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathman_3_printf
57 lines (51 loc) · 1.51 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
.TH _printf 1 "18 March 2020" "version 1.0" "_printf man page"
.SH NAME
.B _printf
.SH SYNOPSIS
.B _printf prototype:
int _printf (const char *format ...)
.SH DESCRIPTION
_printf prints supplied string, replacing the specifiers %(c, s, i, ...) with
argument values.
.SS Return value
If it returns successfully, _printf returns the number of characters printed
(excluding the null byte used to end output to strings).
In case of any error, _printf will return a negative value.
.SS Format of the format string
The arguments must correspond properly with the conversion directive
Each conversion specification is indicated by the
character %, it ends with a conversion specifier.
"%%" it will just print "%".
.SS Conversion specifiers
% is followed by the following specifiers
.TP
%c
it is replaced by the correponding argument value
.TP
%s
It is replaced by the corresponding argument value (but not including)
a terminating null byte '\0'.
.TP
%d, %i The int argument is converted to signed decimal notation.
.TP
%b the int argument is converted to binary.
.SH EXAMPLES
.TP
to print an integer assign to a int varaible var (you can use %i or %d)
_printf("Integer %i", var);
.TP
to print a decimal number in binary (int dec = 348)
_printf("348 in binary is %b", dec);
.TP
to print a char store in a variable ch
_printf("Char %c", ch);
.TP
to print a string
_printf("String %s", "Hello, world!");
.SH SEE ALSO
.I man 3 printf
.SH REPORTING BUGS
Report to https://github.com/ikki2530/printf/
.SH AUTHOR
Angello Villegas and Diego Gómez
.PP