#include
int main(void)
{
int x = 99;
int *pt1;
pt1 = &x;
printf(\"Value at p1: %d\\n\", *pt1);
printf(\"Address of p1 (with %%
sizeof( int * ) need not be equal to sizeof( int )
the library implementation is free to use a different, more appropriate presentation of the pointer value (e.g. hexadecimal notation).
%p is simply "the right thing to do". It's what the standard says should be used for pointers, while using %d is misusing the integer specifier.
Imagine what happens when someone refactors your code, and somewhat over-enthusiastically exchanges all "int" with "long" and all "%d" with "%ld"... oops.