]>
Commit | Line | Data |
---|---|---|
e71c143c AC |
1 | .\" Copyright (c) 2020-2022 by Alejandro Colomar <colomar.6.4.3@gmail.com> |
2 | .\" and Copyright (c) 2020 by Michael Kerrisk <mtk.manpages@gmail.com> | |
3 | .\" | |
4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft | |
5 | .\" | |
6 | .\" | |
ab47278f | 7 | .TH PTRDIFF_T 3type (date) "Linux man-pages (unreleased)" |
e71c143c AC |
8 | .SH NAME |
9 | ptrdiff_t \- count of elements or array index | |
10 | .SH LIBRARY | |
11 | Standard C library | |
12 | .RI ( libc ) | |
13 | .SH SYNOPSIS | |
14 | .nf | |
15 | .B #include <stddef.h> | |
16 | .PP | |
17 | .BR typedef " /* ... */ " ptrdiff_t; | |
18 | .fi | |
19 | .SH DESCRIPTION | |
20 | Used for a count of elements, or an array index. | |
21 | It is the result of subtracting two pointers. | |
2325c425 | 22 | It is a signed integer type |
e71c143c AC |
23 | capable of storing values in the range |
24 | .RB [ PTRDIFF_MAX , | |
25 | .BR PTRDIFF_MAX ]. | |
26 | .PP | |
27 | The length modifier for | |
28 | .I ptrdiff_t | |
29 | for the | |
30 | .BR printf (3) | |
31 | and the | |
32 | .BR scanf (3) | |
33 | families of functions is | |
34 | .BR t , | |
35 | resulting commonly in | |
36 | .B %td | |
37 | or | |
38 | .B %ti | |
39 | for printing | |
40 | .I ptrdiff_t | |
41 | values. | |
3113c7f3 | 42 | .SH STANDARDS |
801a509d | 43 | C99 and later; |
e71c143c AC |
44 | POSIX.1-2001 and later. |
45 | .SH SEE ALSO | |
1971f613 | 46 | .BR size_t (3type) |