1)
#include
voidswap(int *a,int *b)
{int*t;
t=a; a=b;b=t;
}
void
main()
{intx=3,y=5,*p=&x,*q=&y;
swap(p,q);
printf("%d%d\n",*p,*q);
}
执行后输出的结果是
2)
void f( int y,int *x)
{y=y+*x;*x=*x+y;}
void main( )
{int x=2,y=4;
f(y,&x);
printf(“%d %d\n”,x,y);
}
执行后输出的结果是
没错 不大懂诶能不能解释一下呢
|