Kai's Development Blog

C array tricks

Assuming you have an array

int values[ARRAY_SIZE];
containing unsorted int values, and an array of
int *pointers[ARRAY_SIZE];
Have the pointer array point at the elements of the value array in ascending value order.