Yes. It prints the following on my computer:
a=45 pa=10577574
Comments: The statement
printf("a=%d pa=%o\n", a, pa )
prints the contents of a
(an ordinary integer)
and then prints the contents of pa
(using octal).
The variable pa
contains a pointer value,
and there is little reason to print it out, but it is OK to do so.
On your computer you will probably see a different value for pa
.
pa
contains the address of a
, and that value depends
on what choices the compiler made and what is going on inside your computer
at the moment.
You could also have printed out the contents of pa
using
printf("a=%d pa=%x\n", a, pa )
which prints the address using hexadecimal, or even
printf("a=%d pa=%d\n", a, pa )
which prints the same address using decimal. Of course, the address does not change (the 32 bits of the address do not change) but the characters used to represent those bits on the monitor are different.