hi.can someone help me to sort a two dimensional array.. below is how i sort a single dimensional array, i want it in a similar way... im just not good at managing the for loop...
single array :
#include <iostream>
using namespace std;
int main ()
{
int M[5] = { 17, 23, 7, -3, 18};
int i,j;
int temp;
for (j=4; j>0; j--)
for (i=0; i<j;i++)
{
if (M[i] > M[i+1])
{
temp = M[i+1];
M[i+1]= M[i];
M[i] = temp;
}
}
cout << "Sorted List : ";
for (i=0;i<=4;i++)
cout << M[i] << " " ;
return 0
}
`
`