函数值传递和地址传递

#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

posted @ 2019-10-30 21:26  KUUGAXXX  阅读(152)  评论(0编辑  收藏  举报