#include<stdio.h>
void main()
{
void swap(int *x,int y);
int a=5,b-10;
printf("%d,%d\n",a,b);
swap(&a,b);
printf("%d,%d\n",a,b);
}
void swap(int *x,int y)
{
int t;
t=*x;
*x=y;
y=t;
}
为什么结果为
5,10
10,10
void main()
{
void swap(int *x,int y);
int a=5,b-10;
printf("%d,%d\n",a,b);
swap(&a,b);
printf("%d,%d\n",a,b);
}
void swap(int *x,int y)
{
int t;
t=*x;
*x=y;
y=t;
}
为什么结果为
5,10
10,10
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货