Then you need to define the compare function. We use the IComparble<> interface so we don't have to do casting and other stuff we don't want to do. This also means we can only compare Card with Card (which is what you want to do 99.9% of the time anyway).

Now, I don't know what type Rank is, but let us assume that it is some primitive type, like Int32:

Now, we don't have to add the IComparable interface if we don't want to, as you can pass a Comparer<T> to Array.Sort and it will use that to compare the objects. You'd do it this way if you wanted to be able to sort something in different ways. Taking your Card class as an example, we might want to sort on Suit then Rank, or Rank then Suit. But that's a different post, ask if you want to see it done that way, also.

Arrays aren't very suited for C#, in a language like C++ this problem would be much simpler since you can treat a multidimensional array like a flat array. Linq doesn't play nicely with arrays, and neither do many .net objects.

In C# you need to convert it, which is a bit ugly. Here's a working example of what I think you are trying to do in C#: