We can also process an
<int*>
array
whose NULL-elements are "not inserted" but other elements can be 0 as well :)
#include <stdlib.h>
int yourCompareFunc(const void *arg1, const void *arg2)
{
if (arg1 && arg2) {
return (*(int*)arg1) - (*(int*)arg2);
}
return 0;
}
void yourSort(int* piElements, int iElementsCount)
{
qsort(piElements, iElementsCount, sizeof(int*), yourCompareFunc);
}