| 
 
| void  swap(int *p,int *p1){ int temp;
 temp =  *p;
 *p = *p1;
 *p1 = temp;
 //为什么不用以下写法?
 //int *temp;
 //temp=p;
 //p=p1;
 //p1=temp
 //以上交换的是两个值的地址,而不是地址的值。
 //当程序结束之后,属于本函数的内存失效,地址交换失败。
 //所以要交换两个变量对应内存地址中的值
 }
 
 void  main(){
 int a=3;
 int b=4;
 printf(“a=%d,b=%d”,a,b);
 swap(&a,&b);
 printf(“a=%d,b=%d”,a,b);
 }
 | 
 |