为什么但我输入的数a<b时,swap函数没有被执行啊
#include<stdio.h>
int swap(int x,int y);
main()
{
int a,b;
int *p1,*p2;
scanf("%d,%d",&a,&b);
p1=&a; p2=&b;
if(a<b) swap(*p1,*p2);
printf("\n%d,%d\n",*p1,*p2);
}
int swap(int x,int y)
{ int tmp;
tmp=x; x=y; y=tmp;
}
你的条件是if(a<b) 啊