#include <stdio.h>
int f(int *a,int *b)
{
int temp;
temp=*a ;
*a = *b;
*b = temp;
}
int main()
{
int c=3, d=4;
int *p,*q;
p=&c;
q=&d;
f(p,q);
printf("%d %d",c,d);
while(1);
C语言两数实现交换
最新推荐文章于 2024-11-15 17:45:01 发布

#include <stdio.h>
int f(int *a,int *b)
{
int temp;
temp=*a ;
*a = *b;
*b = temp;
}
int main()
{
int c=3, d=4;
int *p,*q;
p=&c;
q=&d;
f(p,q);
printf("%d %d",c,d);
while(1);