How to: Sort Arrays
Unlike standard C++ arrays, managed arrays are implicitly derived from an array base-class from which they inherit common behaviors. A prime example is the Sort method, which can be used to order the items in any array.
For arrays containing simple intrinsic types, you can call the Sort method. The sort criteria can be overridden, which is necessary to sort for arrays of complex types. In this case, the array element type must implement the IComparable::CompareTo method.