#include<stdio.h> void swap(int *a,int *b)//传地址相当于传了真值 { int temp;//而传值在函数结束时销毁 temp=*a; *a=*b; *b=temp; } void main() { int a=2,b=3; swap(&a,&b); printf("a=%d, b=%d",a,b); }