When I run the follwoing code, I get the follwoing
1245048
1245044
1245052
6
I tried changing the value of 'a' and the last line of the code, the printf prints whatever is assigned to 'a'. Please explain me this behaviour.
Code:
void main()
{
int a=6;
int b=1024;
int *swap=(&b-1);
printf("%u\n",&b);
printf("%u\n",swap);
swap+=2;
printf("%u\n",swap);
printf("%d\n",*swap);
}
Swapna



