ascending sort using linked list

hi guys.. i'm having problem sorting.. the logic was right.. but still i dont get why it doesn't run ...
can someone fix dis???

tnx..


void ascending()
{
//temo is like the head
list *temp1, *currtemp, *temp;
temp = new list;
temp1 = new list;
currtemp = new list;
for( temp1 = last; temp1!= NULL; temp1=temp1->next )
{
list *store = temp1;
for(currtemp = temp1; currtemp!= NULL; currtemp=currtemp->next )
{
if(store->name > currtemp->name)
{
temp->name= currtemp->name;
currtemp->name = store->name;
store->name = temp->name;
}
}
}
}
Topic archived. No new replies allowed.