[TOC] ## 指针调用 ``` void swap(int *a,int *b){ int temp; temp =*b; *b = *a; *a = temp; } int a=2; int b=3; swap(&a,&b); //a=3,b=2 ``` ## 引用传值 ``` void swap(int *a,int *b){ int temp; temp =*b; *b = *a; *a = temp; } int a=2; int b=3; swap(a,b); //a=3,b=2 ```