http://tieba.baidu.com/p/3357383646因为你想从swap内改变exchange内的变量,应该传递变量的地址值
void swap(int **p1,int **p2)
{
int *temp;
temp=*p1;
*p1=*p2;
*p2=temp;
}
void exchange(int *q1,int *q2,int *q3)
{
if(*q1<*q2) swap(&q1,&q2);
if(*q1<*q3) swap(&q1,&q3);
if(*q2<*q3) swap(&q2,&q3);
}