|
Are you trying to eliminate duplicates, sort or what?
Using search.h and maybe lsearch() or hsearch() will do what you need. If the data is redundant, hsearch() is not the best choice.
I personally deal with stuff like this by creating an array of pointers, then sorting the array using qsort, which allows one to access an element with bsearch() using a key. Sorting an array of structs is too expensive. But it is not clear what you need.
|