You can actually just run through the 2D array and make your comparisons and swap when necessary. For instance, you may compare Array [3][1] with Array [4][6] and decide whether to swap them or not. This approach merely requires a loop for each dimension. For example,
Code:
for (i = 0; i < rowMax; i++)
{
    for (j = 0; j < colMax; j++)
    {
        // Put your sort stuff here, which will require two more loops
...
This approach will allow you to sort a 2D array which is not an actual 2D array, such as one where each row is gotten independently from malloc or new. All you have to do is get the indexing or pointing right in the loops.