//Ex4_11.cpp
#include "iostream" 
using namespace std;
void main( ) 
{int a,b,*p1=&a,*p2=&b,*p; 
 cout<<"Input a  b:"; 
 cin>>a>>b; 
 cout<<"a="<<a<<",b="<<b<<endl; 
 //输出交换前p1和p2所指向的变量的值 
 cout<<"*p1="<<*p1<<",*p2="<<*p2<<endl; 
 p=p1;p1=p2;p2=p;   // 交换两个指针 
 cout<<"a="<<a<<",b="<<b<<endl; 
 //输出交换后p1和p2所指向的变量的值  
 cout<<"*p1="<<*p1<<",*p2="<<*p2<<endl;
}
