Debian Codegraph @

upstream/debian-trixie/man3/ptrdiff_t.3type

raw
1 .\" Copyright (c) 2020-2022 by Alejandro Colomar <[email protected]>
2 .\" and Copyright (c) 2020 by Michael Kerrisk <[email protected]>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\"
7 .TH ptrdiff_t 3type 2024-05-02 "Linux man-pages 6.9.1"
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 .P
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.
22 It is a signed integer type
23 capable of storing values in the range
24 .RB [ PTRDIFF_MIN ,
25 .BR PTRDIFF_MAX ].
26 .P
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.
42 .SH STANDARDS
43 C11, POSIX.1-2008.
44 .SH HISTORY
45 C89, POSIX.1-2001.
46 .SH SEE ALSO
47 .BR size_t (3type)