30分钟彻底学会C语言指针
这条语句没啥问题关键是*p2 = temp;有问题应该是*p2 = *temp;
void swap(int *p1,int *p2) { int temp; temp=*p1; *p1=*p2; *p2=temp;}