include <stdio.h>
void main()
{
void swap(int x,int *y);
int a=5,b=10;
swap(a,&b);
printf("%d,%d\n",a,b);
}
void swap(int x,int *y)
int t;
t=x;
x=*y;
*y=t;
运行结果5,5
如果a=8其他不变 结果是8,8
swap这个函数作用是把a,b互换的意思吧?
不解
相关分类