-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathman_3_printf
More file actions
63 lines (57 loc) · 1.89 KB
/
man_3_printf
File metadata and controls
63 lines (57 loc) · 1.89 KB
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
.\" Manpage for _printf borrowed from the actual printf(3) manual page and may contain some unforeseen errors.
.TH man 8 "23 October 2018" "1.0" "_printf man page"
.SH NAME
_printf - format and write a string, character, or integer to stdout
.SH SYNOPSIS
#include "main.h"
.br
#include <stdarg.h>
.br
#include <stdlib.h>
.br
.br
int _printf(const char *format, ...)
.SH DESCRIPTION
The function _printf() produces output according to a format as described below. The functions printf() writes output to stdout, the standard output stream.
.SS Return value
Upon successful return, these functions return the number of characters
printed (excluding the null byte used to end output to strings).
If an output error is encountered, a negative value is returned.
.SS The format string:
.br
The format string is a character string, composed of zero or more directives: ordinary characters (not %), which are copied unchanged to the output stream. Each conversion specification is introduced by the character %, and ends with the conversion specifier.
.SS The conversion specifiers:
.br
A character that specifies the type of conversion to be applied. The conversion specifier and their meanings are:
.br
d, i - The int argument is converted to signed decimal notation.
.br
c - The int argument is converted to an unsigned char, and the resulting character is written.
.br
s - The const char * argument is expected to be a pointer to an array of character type (pointer to a string).
.SH EXAMPLE
.br
Print a string literal:
.br
int a = 0;
.br
char *a_string = "cat";
.br
a = _printf("test %s\n", a_string);
.br
printf("%d\n", a);
.br
return (0);
.br
.SS General Formatting:
.br
_printf("example format string [ % [ (c) (s) (d) (i) ]]", [variable] [string literal)
.br
.SH SEE ALSO
printf(1), asprintf(3), dprintf(3), scanf(3)
.br
.SH BUGS
No known bugs so far.
.SS COLOPHON
.br
This page was borrowed from the actual printf manual page.