为什么要用指向结构体的二重指针
struct student *p1,*p2;假设有这样两个指向结构体的结构变量。
swap(struct student *p1,struct student *p2)//这个函数用来完成两个指针的互换。
{
p1=p2;
}
在主函数中
swap(p1,p2);
printf("%d",(*p1).score);
经测试是可以完成p1与p2的互换的,为什么还要用二重指针指向结构体呢?
swap(struct student**p1,struct student**p2);
swap(&p1,&p2);