请教高手,希望有高手解答
void Swap3(int &x,int &y)有这样定义函数的吗?若有,怎么样用它来实现两数交换?请高行指教,谢谢!
2005-04-22 20:42
2005-04-22 21:26
2005-04-22 22:54
2005-04-23 00:07
2005-04-23 01:27
2005-04-23 12:20
2005-04-24 09:06
在C语言中使用指针实现 #include <stdio.h> #include <conio.h>
void swap1(int *,int *);
int main() { int a=10,b=20; printf("before swap: a=%d b=%d\n",a,b); swap1(&a,&b); printf("after swap: a=%d b=%d\n",a,b); getch(); return 1; }
void swap1(int *a,int *b) { int temp; temp=*a; *a=*b; *b=temp; }

2005-04-24 09:28
2005-04-24 13:45