I am a student who is studying pointer unit.
I posted this message to get a lesson from my seniors because I was ignorant and couldn't understand it well.
First of all, thank you so much for reading my article.
int main(){
int a;
int* pa;
pa = &a;
a = 1;
printf ("'a' something: %p\n", a);
printf ("'a' address : %p\n", &a);
printf ("'a' value : %d\n\n", a);
printf ("'pa' address value : %p\n", pa);
printf("'*pa' address value? : %p\n", *pa);
return 0;
}
result
'a' of what?: 0x1
'a' address: 0x7ffd407638b8
'a' value : 1
'pa' address : 0x7ffd407638b8
'*pa' address : 0x1
Here's the question.
Question1. I would like to ask if the value printed through the %p format means something, even though variable a is not a pointer.
Question2. I would like to ask you if there is a different reason why the result of printing the 'pa' through %p format and the result of printing '*pa' %p format even the same pointer called p.
Question3. If I understood the above two questions, I don't need to ask about this.*why variable a is the same as the 'a' printed in the %p format and pointer '*pa' printed in the %p format.
Thank you.
Thank you so much for taking your time to read my article.