-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathman_3_printf
73 lines (73 loc) · 1.75 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 2 "27 October 2020" "_printf man page"
.SH NAME
.B _printf
- output conversion.
.SH SYNOPSIS
#include "holberton.h"
.RS 0
int _printf(const char *format, ...)
.RS 0
int print_c
.RS 0
int print_s
.RS 0
int print_d
.RS 0
int print_i
.RS 0
.SH DESCRIPTION
The family of function _printf() produce output accordin to a format, the function _printf() write output to stdout, the standard output stream, print_s() can handle the conversion s to write a string STR and print_c() can handle the conversion c write a character C.
.RS 0
The function printf_d() handle the conversion d to write a signed decimal integer, printf_i() can handle the conversion i to write an integer. They are all caled with va_list instead of a variable number of argument.
.SH EXIT VALUE
Once successful exit, these functions return the number of characters printed (excluding the null byte).
.SH The conversion specifier
Character that specifies the type of conversion:
.RS 0
.B %d, %i:
.RS 0
For integers we use either 'd' or 'i', so the int argument is converted to signed decimal notation.
.RS 0
.B %s:
.RS 0
For strings we use 's', so the const char *argument is expected to be a pointer to an array of character type (pointer to a string).
.RS 0
.B %c:
.RS 0
To print a character.
.RS 0
.B %R:
.RS 0
To print the rot13 of a string.
.RS 0
.B %p:
.RS 0
To print the pointer data type.
.RS 0
.B %u:
.RS 0
To print an unsigned integer.
.RS 0
.B %%:
.RS 0
To print %.
.SH BUGS
No known bugs.
.SH EXAMPLE
To print "Hello Holberton" use:
.RS 0
#include "holberton.h"
.RS 0
_printf("%s", "Hello Holberton");
.RS 0
To print "My age is, 21" use:
.RS 0
#include "holberton.h"
.RS 0
_printf("%s, %d", "My age is", 23);
.SH AUTHOR
Jenni Hadir and Med Foued.
.SH COPYRIGHT
C language.
.SH SEE ALSO
.I printf(3), write(2)