hello people, I have a problem in sorting linked list according to id number of student in secondary school system ,the code is not working .can any body help me please ?!!
Here Is my code.
void sortbyID()
{
struct school *pre;
struct school *move;
move=head;
pre=move;
move=move->next;
while (pre!=NULL && move!=NULL)
{
if ((pre->id)>=(move->id))
{
move=pre;
pre=pre->next;
}
{ pre=pre->next;
} move=move->next;
}
getch();
}