-
Notifications
You must be signed in to change notification settings - Fork 1
/
man_3_printf
87 lines (67 loc) · 1.86 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
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh
.TH MY_PRINTF 3 "December 2023" "Version 1.0" "My Printf Manual"
.SH NAME
my_printf \- Custom printf implementation
.SH SYNOPSIS
.B #include <stdio.h>
.br
.B #include <stdarg.h>
.br
.B #include <stdlib.h>
.br
.B #include <unistd.h>
.br
.B #include "main.h"
.br
.B int _printf(const char *format, ...);
.SH DESCRIPTION
The
.B my_printf
function is a custom implementation of the printf function, supporting the format specifiers %c, %s, %d, and %i.
.PP
.B _printf
formats and prints data to the standard output stream (stdout) according to the specified format string. The format string may contain placeholders (format specifiers) that begin with the % character, followed by conversion characters.
.SH PARAMETERS
.B format
is a string that specifies the format of the output. It may contain ordinary characters and format specifiers.
.B ...
represents additional arguments corresponding to the format specifiers in the format string.
.SH RETURN VALUE
The total number of characters written is returned. A negative value is returned in case of an error.
.SH FORMAT SPECIFIERS
The following format specifiers are supported:
.TP
.B %c
Prints a character.
.TP
.B %s
Prints a string.
.TP
.B %d, %i
Prints a signed decimal integer.
.SH EXAMPLES
.B #include "main.h"
.br
.B int main() {
.br
.B _printf("Hello, %s! The answer is %d.\n", "world", 42);
.br
.B return 0;
.br
.B }
.SH SEE ALSO
.BR printf(3)
.SH AUTHOR
Written by Mammadzade Sakina.
.br
Zeynal Mustafayev
.SH REPORTING BUGS
Report bugs to [email protected]
.SH COPYRIGHT
Copyright (C) 2023 Holberton Azerbaijan. Free use of this software is granted under the terms of the MIT License.
.SH NOTES
This manual page is not an exhaustive documentation of all features and options. For detailed information, refer to the source code and accompanying documentation.
.SH VERSION
Version 1.0
.SH DATE
December 2023