I have tried to fixed the following sort function for my linked list but unfortunately i can't get it to work. What is happening is that it keep deleting the node that need to be moved but when i add a node to the end then it sort everything except the head of the list. So any help will be greatly appreciated.
this is the struct to let you have and idea of the list:
Your problem is because you need to pass the address of the head of the list. i.e. you should do struct member_account *sort(struct member_account **list)