- #include <stdio.h>
- #include <string.h>
- /*:
- 数值互换
- */
- //2019 年 8 月 28
- void fun(int * num_to, int * num)
- {
- int temp;
- temp=*num;
- *num=*num_to;
- *num_to=temp;
- }
- int main()
- {
- int i=9,j=10;
- printf("i=%d,j=%d\n",i,j);
- fun(&j,&i);
- printf("i=%d,j=%d",i,j);
- return 0;
- }
来源: http://www.bubuko.com/infodetail-3175380.html