Ask your own question, for FREE!
Computer Science
OpenStudy (anonymous):

A link list problem, i need some how to sort and print out an object by surname in alphabetical order. i have a try to do that by this code not working for swamping i should i go about that? void functions::printdata() { for(node* temp1=head;temp1!=NULL;temp1=temp1->next) { for(node* temp2=head;temp2!=NULL;temp2=temp2->next) { if(temp2->client.getsurname() > temp1->client.getsurname()) { clienttype swap=temp1->client; temp1->client=temp2->client; temp2->client=swap; } } }

OpenStudy (e.mccormick):

Did you try looking at the values and types of your assorted objects to make sure you don't have any oddities happening there? Like an address getting confues with a value.

OpenStudy (anonymous):

Oh i joke my self with it.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!