-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathman_3_printf
73 lines (49 loc) · 1.54 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
.TH man 3 "14 November 2023" "1.0" "_printf man page"
.SH NAME
.B _printf
- format and print data.
.SH SYNOPSIS
_printf FORMAT [ARGUMENT]...
.SH DESCRIPTION
Print ARGUMENT(s) according to FORMAT:
\" double quote.
\\ backslash.
\n new line.
\r carriage return.
\t horizontal tab.
%% a single %.
.SH CONVERSION CHARACTERS
.B The conversion specifiers and their meanings are:
.IP -b
The unsigned int argument is converted to binary.
.IP -d,i
The int argument is converted to signed decimal notation.
.IP -c
The int argument is converted to an unsigned char, and the resulting character is written.
.IP -o,u,x,X
The unsigned int argument is converted to ( ) notation:
unsigned octal: (o).
unsigned decimal: (u).
unsigned hexadecimal: (x and X).
.IP -s
Characters from the array are written up to (but not including) a terminating null byte ('\0').
.IP -S
Characters from the array are written up to (but not including) a terminating null byte ('\0').
Not include characters (0 < ASCII value < 32 or >= 127), are printed \x, , followed by the ASCII code value in hexadecimal (upper case - always 2 characters).
.IP -p
The void * pointer argument is printed in hexadecimal (as if by %#x or %#lx).
.SH EXAMPLES
.IP - Print a string.
_printf("This is a string");
_printf("%s\n", "I am a string too!");
.IP - Print a character.
_printf("Character:[%c]\n", 'H');
.IP - Print an integer.
_printf("%d, %i\n", 2, 5);
.SH SEE ALSO
.I printf(1),
.I printf(3).
.SH BUGS
No known bugs.
.SH AUTHOR
Philip Owusu Koranteng & Edmund Sagoe