phonenode *start_ptr = NULL;
phonenode *crrnt_ptr;
void alpha_order(){
phonenode *ptr, *curr, *temp;
ptr = start_ptr;
for(bool didSwap = true; didSwap;){
didSwap = false;
for(curr = ptr; curr->next != NULL; curr = curr->next){
if (curr->surname > curr->next->surname){
temp = curr;
curr = curr->next;
curr->next = temp;
didSwap = true;
}
}
}
}
here is my code which does not work..
from for loop it will check if surname > next->surname and if it is true that it will be swap all curr linked list.