I use qsort from C libary and I have datatype
Element_type **pElement and Element_type is struct typedef element_type {int ,char ....}
example, and i call quicksor function with
qsort(*pElement,iCountElement,(size_t)sizeof(Element_type),compare);
and callback function
static int compare(const void *p1, const void *p2) {
Element_type *a1 = (Element_type *)p1;
Element_type *a2 = (Element_type *)p2;
return ( (a2)->iServiceId < (a1)->iServiceId );
}
but I always get segmentation fault. Why?