Pointer variables just points to other variable addresses in memory. And pointer variables have their own address in memory obviously.
However, This code is giving out the same memory address for both.
int num=10;
int *ptr=#
printf("Address of variable num: %p\n",ptr);
printf("Address of pointer ptr: %d\n",&ptr);
If a print both of them at the same time then it appears to work as expected.
Address of variable num: 0028FF3C
Address of pointer ptr: 0028FF38
But if I print them at one at a time then it's giving same address for both.
printf("Address of variable num: %p\n",ptr);
//printf("Address of pointer ptr: %d\n",&ptr);
Address of variable num: 0028FF38
//printf("Address of variable num: %p\n",ptr);
printf("Address of pointer ptr: %d\n",&ptr);
Address of pointer ptr: 0028FF38