这种对换的方式有问题吗,为什么一运行就什么都不显示

void index(struct customer **head)
{
struct customer *arrowhead;
struct customer *compare;
struct customer *temp1,*temp2;
arrowhead=*head;
for(;arrowhead!=NULL;)
{
compare=arrowhead->next;
for(;compare!=NULL;)
{

    if(strcmp(arrowhead->index,compare->index)>0)
    {
        temp1=arrowhead;
        arrowhead=compare;
        compare=temp1;
        temp2=arrowhead->next;
        arrowhead->next=compare->next;
        compare->next=temp2;
    }
    compare=compare->next;
   }
   arrowhead=arrowhead->next;
}

}

temp2 那段不需要。