I 开发者_如何转开发need to sort an array of pointers to struc. In fact, I need to do searching among adresses to see if a given pointer to a struct is present in the array. Unfortunately, I don\'t hav
bsearch is pretty good for direct search, but what should I use if I need for example search range? update
If I have two functions: void SortStudents(char *studentList[], size_t studentCount) { qsort(studentList, sizeof(studentList)/sizeof(studentList[0]), sizeof(studentList[0]), Compare);
Does anyone know how the standard binary search function is implemented? This is the prototype. void * bsearch (const void*, const void*, size_t, size_t, int (*) (const void *, const voi开发者_Stack