6.8 Arrays and Pointers
ISO Standard | Implementation |
---|---|
“The result of converting a pointer to an integer or vice versa (C90 6.3.4, C99 6.3.2.3).” | |
A cast from an integer to a pointer or vice versa results uses
the binary representation of the source type, reinterpreted as appropriate for
the destination type. If the source type is larger than the destination type, the most significant bits are discarded. When casting from a pointer to an integer, if the source type is smaller than the destination type, the result is sign extended. When casting from an integer to a pointer, if the source type is smaller than the destination type, the result is extended based on the signedness of the source type. |
|
“The size of the result of subtracting two pointers to elements of the same array (C90 6.3.6, C99 6.5.6).” | |
The signed integer result will have the same size as the pointer operands in the subtraction. |