-
Notifications
You must be signed in to change notification settings - Fork 0
/
man_3_printf
62 lines (47 loc) · 1.11 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
.\" Manpage for _printf
.TH _printf (3) "19/10/2022" "1.0" "_printf Project Manual Page"
.SH NAME
_printf
\_printf - This function produces output according to a format.
.SH SYNOPSIS
.B #include "main.h"
.B int _printf(const char *format, ...)
.SH DESCRIPTION
.PP
Produce output to stdout according to a format described below similar to the printf() function.
.SH OPTIONS
.RS
.nf
- %c - Prints a single char.
- %s - Prints the argument as a string.
- %% - Prints a single perecentage sign to the stream.
- %i / %d - Prints signed decimal integer.
.RE
.SH EXAMPLES
.B With main.c we can test our functions:
.PP
#include "main.h"
.PP
_printf("Character:[%c]\n", 'H');
.PP
Output: character: H
.PP
_printf("String:[%s]\n", "I am a string !");
.PP
Output: string: I am a string !
.PP
_printf("Percent:[%%]\n");
.PP
Output: percent: %
.PP
_printf("integer: %i\n", 10);
.PP
Output: integer: 10
.PP
_printf("decimal: %d\n", 100);
.PP
Output: decimal: 100
.B Return value
On success, _printf returns the number of printed characters. If formats is error or NULL returns -1
.SH AUTHORS
Chimdindu Chukwuka,Tobechukwu Onuigbo