Dows anyone have any tips on how to sort a list of words (names) ??? thanx
Dows anyone have any tips on how to sort a list of words (names) ??? thanx
qsort().
manually?
Oh, I don't know. strcmp perhaps?
Quzah.
Hope is the first step on the road to disappointment.
Names are normally sorted by sorting the last name (w/ Jr, Sr, III, etc) major, left justifed, and any other (first, middle or initial) asa secord unit, left justified minor.
Alpha is always sorted left justified as if there were enough blanks following to fill out the compare.
Sorry. Mistake. Put the Jr,Sr,III,Esq,etc after the middle initial or name as part of that unit.
Minor field is sorted first, then the major using a sort method that maintains order - or convert into a single field with major to the left of minor and sort by any method.
There are too many ways to sort things to describe any here, just use qsort() (a C library function commonly available), or look up other methods on Google.