The suspected violation of this floor has been folded by the system. Hide this floor to view this floor
void Delete(student_info * * Head)
{
int flag=1;
int number;
student_info * p,*q;
printf("Please enter the student ID of the student you want to delete: ");
scanf("%d",&number);
p=q=*Head;
while(p!=NULL && flag)
{
if (p->number==number)
{
printf("The information you want to delete is as follows (valid after selecting operation [10]):\n");
printf("学号:%-10d",p->number);
printf("姓名:%-10s",p->name);
printf("Birthplace:%-10s\n",p->bornplace);
if(p==*Head)
{
*Head=p->next;
free(p);
}
else
{
q->next=p->next;
free(p);
}
flag=0;
}
else
{
q=p
p=p->next;
}
}
if(flag)
printf("No data to delete found!!");
}
I don't understand this concept very well, thank you!