ptrdiff_t - count of elements or array index
Contents
Description
Used for a count of elements, or an array index. It is the result of subtracting two pointers. It is a
signed integer type capable of storing values in the range [PTRDIFF_MIN, PTRDIFF_MAX].
The length modifier for ptrdiff_t for the printf(3) and the scanf(3) families of functions is t,
resulting commonly in %td or %ti for printing ptrdiff_t values.
History
C89, POSIX.1-2001.
Library
Standard C library (libc)
Name
ptrdiff_t - count of elements or array index
See Also
size_t(3type) Linux man-pages 6.9.1 2024-05-02 ptrdiff_t(3type)
Standards
C11, POSIX.1-2008.
Synopsis
#include<stddef.h>typedef /* ... */ ptrdiff_t;
