ni********@yahoo.com (nilesh) wrote in message news:<29************************@posting.google.co m>...
Hello,
I have a basic doubt. Consider following program :
#include<stdio.h>
int main()
{
int i, *ip;
i = 10;
ip = &i;
printf("%x\n", ip);
printf ("%p\n", (void*) ip);
return 0;
}
When I print the value of ip i.e. the address of integer i, does it
prints the virtual address of integer i or physical address of i ?
I'm pretty sure that's specific to the implementation; for example, if
you're running a user program on a *nix or Windows platform, it's
almost certainly a virtual address. If you were running on bare
metal, it would probably be a physical address (then again, if you
were running on bare metal, you probably wouldn't have a working
printf() available anyway).