Kindly explain the difference between the virtual and physical addresses based on the following example. Please explain which address is specifically used here and how to use the other address in the same place. Also, how can the two always be distinguished.
code:
if(fork()==0)
{
a=a+5;
printf("%d%d", a, &a);
}
else
{
a=a-5;
printf("%d%d", a, &a);
}
What address does &a
refer to in both the statements?