uintptr_t
and intptr_t
are numerical types big enough to contain pointers, my question is how do they relate to other numerical types when casting toward them. Specifically which types (int
, long
, long long
, short
, char
, size_t
etc.) cant NUM_TYPE
be defined as so that the next function does not corrupt the value of n
?
intptr_t cast_num(NUM_TYPE n){return (intptr_t) n;}