It's defined in /usr/include/stdint.h
:
typedef long int intptr_t;
is it supposed to be a type for integer or pointer?
uintptr_t is an unsigned integer type that is capable of storing a data pointer (whether it can hold a function pointer is unspecified). Which typically means that it's the same size as a pointer.
It's defined in /usr/include/stdint.
It is a signed integer type that is big enough to hold a pointer.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With