注意:是传送地址,才能改变原数据!!!
#include<stdio.h>标签:return,函数,int,交换,程序,pb,pa,swap,printf From: https://blog.51cto.com/u_15923331/5983161
void swap(int* pa, int* pb)
{
int z = 0;
z = *pa;
*pa = *pb;
*pb = z;
return 0;
}
int main()
{
int a = 210;
int b = 320;
printf("%d %d\n", a, b);
swap(&a,&b);
printf("%d %d", a, b);
return 0;
}