Well, there is no portable way to achieve this, in C. C does not provide any portable functions specifically designed to point to a specific numerical address. However, the "secret" intention of explicitly converting an integer pointer is actually this: implement a "natural" comparison between integers and pointers, where "natural" usually means that the numeric value of the integer remains unchanged (if possible) when converting it to a pointer type . In other words, all you need is an integer with value0. , , . ( , , ).
,
uintptr_t i = 0;
void *p = (void *) i;
, 0. , C ( ++)
const uintptr_t i = 0;
void *p = (void *) i;
, 0.
void *p = 0;
.
C FAQ , .