Hi, i am new to programming..
i have a code like
#include<iostream.h>
using namespace std;
int main()
{
int x,y;
int *p1,*p2;
p1=&x;
p2=&y;
*p1=10;
*p2=*p1;
p1=p2;
*p1=20;
cout<< x << y;
return 0;
}
I do not understand it.. output is x =10 and y=20.. But both x and y should be 20 is it not ? pls help...