I have a program that will populate a 2d array with random numbers and sort it. But I need it to exclude elements with a zero subscript, and I can't get that to work. Please help.

{
double arr[rows][cols];
int i, j, temp;
int *arr_ptr;
arr_ptr=(int*)arr;

srand(time(NULL));

for(i = 0; i < rows; i++)
{
for(j = 0; j < cols; j++)
if(i == 0) 
arr[i][j] = 0;
else     
arr[i][j] = 1 + rand() % 100;
}
 for(i = 1; i < rows; i++)
arr[i][0] = 0;


for(i = 0; i < (rows * cols) - 1; i++)
for(j = i + 1; j < row * cols; j++)
if(*(arr_ptr + i) > *(arr_ptr + j))
{
temp = *(arr_ptr + i);
*(arr_ptr + i) = *(arr_ptr + j);
*(arr_ptr + j) = temp;}

cout<<endl;

for(i = 0; i < rows; i++)
{
 for(j = 0; j < cols; j++)
{cout << setw(7) << arr[i][j];}
cout << endl;
}

return 0;
}