cplusplus.com cplusplus.com
cplusplus.com   C++ : Reference : C Library : cstddef (stddef.h) : ptrdiff_t
 
- -
C++
Information
Documentation
Reference
Articles
Sourcecode
Forum
Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
C Library
cassert (assert.h)
cctype (ctype.h)
cerrno (errno.h)
cfloat (float.h)
climits (limits.h)
clocale (locale.h)
cmath (math.h)
csetjmp (setjmp.h)
csignal (signal.h)
cstdarg (stdarg.h)
cstddef (stddef.h)
cstdio (stdio.h)
cstdlib (stdlib.h)
cstring (string.h)
ctime (time.h)
cstddef (stddef.h)
macros:
· NULL
· offsetof
types:
· ptrdiff_t
· size_t

-

ptrdiff_t type
<cstddef>

Result of pointer subtraction

This is the type returned by the subtraction operation between two pointers. This is a signed integral type, and as such can be casted to compatible fundamental data types.

A subtraction of two pointers is only granted to have a valid defined value for pointers to elements of the same array (or for the element just past the last in the array).

For other values, the behavior depends on the system characteristics and compiler implementation.

© The C++ Resources Network, 2000-2007 - All rights reserved
Spotted an error? - contact us