Sorting a (array based) database?

I'm just curious if anyone knows if there is a ready made function in C++ to sort (numerically or alphabetically) multiple arrays based on a particular array?

i.e. Imagine you have multiple arrays or a multi-dimentional array containing data about users (name, age, etc.)

Is there a function that for example can sort it by name, and automatically shift the age so they still correspond to the correct user name?
you may want to look at std::algorithms.

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

or you can use std::map (associative arrays) to keep your data sorted at all times.
Use a structure instead, then sort the structures.
Topic archived. No new replies allowed.