How to Sort 2D array with out 1D array
By dynamic I presume you mean either:
int* array = malloc(sizeof(int)*col*rows);
or
int* array = new int[rows][col]();
In which case its fairly simple:
void sort(int* array, int size)
{
    int temp, idx, kdx;
    for(idx = 0; idx &lt; size; idx++)
    {
        for(kdx = 0; kdx &lt; size; kdx++)
        {
            if(array[kdx] &gt; array[kdx+1])
            {
                temp = array[kdx + 1];
                array[kdx + 1] = array[kdx];
                array[kdx] = temp;
            }
        }
    }
}

//in main or wherever
int* array = malloc(sizeof(int)*col*rows);
random(array, col*rows);
sort(array, col*rows);
free(array);

Although that is a very sloooooowwwwww sorting operation. How about researching logsort or quicksort?