标签:int return 函数 sharp es2017 and 之间 hang 通信
//使用指针完成两个数之间的交换
#include <stdio.h>
void interchange (int *u,int *v);
int main()
{
int x=5,y=10;
printf("originally x=%d and y= %d \n",x,y);
interchange(&x,&y);//向函数传送地址
printf("now x=%d and y= %d\n",x,y);
return 0;
}
void interchange (int *u,int *v)
{
int temp;
temp = *u;//temp得到u指向的值
*u=*v;
*v=temp;
}
标签:int return 函数 sharp es2017 and 之间 hang 通信
原文地址:http://www.cnblogs.com/ZZiz/p/7593808.html