After all, both these statements do the same thing...
int a = 10;
int *b = &a;
printf("%p
",b);
printf("%08X
",b);
For example (with different addresses):
0012FEE0
0012FEE0
It is trivial to format the pointer as desired with %x
, so is there some good use of the %p
option?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…