That would be the following macros from inttypes.h
:
For printf
:
PRIdPTR PRIiPTR PRIoPTR PRIuPTR PRIxPTR PRIXPTR
For scanf
:
SCNdPTR SCNiPTR SCNoPTR SCNuPTR SCNxPTR
Usage example:
uintptr_t p = SOME_VALUE;
printf("Here's a pointer for you: %" PRIxPTR "
", p);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…