Parallel arrays vs array of structs

This is a discussion on Parallel arrays vs array of structs within the C++ Programming forums, part of the General Programming Boards category; How would you sort 5 parallel arrays in ascending order?...

If I understand what you're talking about right, you basically want to create a sixth temporary array that tracks the position of where all the original elements are. Then sort whichever array you're basing the sort off of. As you do this, keep up with the changes in the temporary array. Once you're done sorting the first, use the sixth to sort two through five.