Check this out
Code:
#include <stdlib.h>
#include <stdio.h>
int sorter(const void *a, const void *b)
{
return *(const int *a) - *(const int *)b;
}
int main(void)
{
int my_values[] = {1,7,35,12,133,-17,32,151,16737};
int **array;
int i;
if((array = malloc(sizeof(my_values) / sizeof(*my_values) * sizeof(int *))))
{
for(i = 0; i < sizeof(my_values) / sizeof(*my_values); i++)
array[i] = my_values + i;
}
qsort(array, sizeof(my_values) / sizeof(*my_values), sizeof(int *), sorter);
for(i = 0; i < sizeof(my_values) / sizeof(*my_values); i++)
printf("%d\n", *array[i]);
return 0;
}
Abstract.