Hi, I am hoping that someone can help me with a relatively simple array sorting problem.

I have one array of 4 double elements e.g. {3, 8, 5, 2}

The position of each element in the array has meaning e.g. the value 5 belongs to "machine 3" (as the 3rd element in the array - position 0 = "machine 1")

I need to create a second array that contains the positions of the values in the array above in ascending order e.g. {3, 0, 2, 1}

I can't touch the first array - it must remain as it is.

Could someone perhaps give me some demo code?


Thank you for reading