It\'s defined in /usr/include/stdint.h
:
typedef long int intptr_t;
is it supposed to be a type for integer or p
It is a signed integer type that guaranteed to can hold a void*
type.
And why there is also [u]intptr_t
? Because:
Any valid pointer to void can be converted to
intptr_t
oruintptr_t
and back with no change in value. The C Standard guarantees that a pointer to void may be converted to or from a pointer to any object type and back again and that the result must compare equal to the original pointer. Consequently, converting directly from achar *
pointer to auintptr_t
is allowed on implementations that support theuintptr_t
.
It is a signed integer type that is big enough to hold a pointer.