Don't do that if you can avoid it.
C99 (and newer) support a type named uintptr_t
. It's an integral type that is capable of holding a pointer value. See stddef.h for more info.
Visual Studio is not known to fully support C99. Hence, you might not get that to work but it's worth a try.
char* c = <some value>;
uintptr_t ptr = (uintptr_t)c;
If you compile the c source file as C++ source, (using /TC
compiler option), you should be able to use that.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…