C 语言指针。。。。
#include<stdio.h>
void swap(int* p1,int* p2)
{
int t;
t = *p1;
*p1 = *p2;
*p2 = t;
}
int fun1()
{
int a=1,b=2;
swap(&a,&b);
printf("%d %d\n",a,b);
return 0;
}
int fun2()
{
int a=1,b=2;
int * p;
int * q;
p = &a;
q = &b;
swap(p,q);
printf("%d %d\n",a,b);
return 0;
}
qq_43764043
2020/12/01 23:59- c语言
- 点赞
- 收藏
- 回答
1个回复
