为什么没有交换
# include <iostream>using namespace std;
void swap (int *p1, int *p2);
int main()
{
int *pointer_1, *pointer_2, a, b;
a=45;
b=78;
pointer_1=&a;
pointer_2=&b;
if(a<b)
swap(pointer_1,pointer_2);
cout<<"max="<<a<<" "<<"min="<<b<<endl;
return 0;
}
void swap(int *p1, int *p2)
{
int *temp;
temp =p1;
p1=p2;
p2=temp;
}
为什么 里面的数字 没有交换???