array sorting

Hi,
I wonder if there is a function that can sort one column of array according to other array.
e.g. first columns contains names, the second column contains a score for each name, and I want to sort the names according to their grades?
Thanks
Tomer
a map does that automatically

http://www.cplusplus.com/reference/stl/map/
Or, you could introduce your own comparison function with a functor and use the containers iterators (or simply pointers), and use the algorithms of C++, there's a function called sort there

http://www.cplusplus.com/reference/algorithm/

Topic archived. No new replies allowed.