#include<stdio.h>
swap(int* pa, int* pb)
{
int tmp = 0;
tmp = *pa;
*pa = *pb;
*pb = tmp;
}
int main()
{
int a = 10;
int b = 20;
printf("a=%d,b=%d\n", a, b);
swap(&a, &b);
printf("a=%d,b=%d\n", a, b);
return 0;
}
标签:tmp,函数,int,交换,pb,pa,swap,printf
From: https://blog.51cto.com/u_16168351/6554294