函数值传递和地址传递
#include<stdio.h>
void fun (int *a,int *b)
{
int *t;
t=*a;
*a=*b;
*b=t;
}
int main(void)
{
int x=3,y=5;
fun(&x,&y);
printf("%d,%d\n",x,y);
}
//5,3
Press any key to continue
本人博客主要供自己整理学习使用,会有部分内容网络摘抄,方便学习