求助:指针问题
#include<iostream.h>void swap(int *p1,int *p2)
{
int p=0;
p=*p1;
*p1=*p2;
*p2=p;
}
main()
{
int a,b;
int *pointer_1,*pointer_2;
cin>>a>>b;
pointer_1=&a;
pointer_2=&b;
if(a<b)
swap(pointer_1,pointer_2);
cout<<*pointer_1<<" "<<*pointer_2;
}
求高手指点,以上程序为何无法达到交换的效果