print index of array

how to print an array of int numbers and their original indexes ? (At the beginning, the unsigned int numbers are in a completely random order. so i have to sorth them in high to low order and vice versa.)
So for example I have int number[]={32,92,11,72}

Example :
Before
Numbers: 32 91 11 72
Indexes: 0 1 2 3
After
Numbers: 11 32 72 91
Indexes: 2 0 3 1

I have to use this prototype:
void swap(int array[],int swapedIndexes [], int size)

an example of how to use it would be:
int array[5]={2, 4,0,-5,3};
int sortedIndexes[5];
sortMe(array,sortedIndexes, 5, 'a');

So the thing here is that the swap in the function does NOT re-arrange elements in the array so it just uses a second array of indexes for the elements in the original array and then swap sorts the second array based on the values in the original array.

Can somebody help me please??


Topic archived. No new replies allowed.