Driver code
int main ( ) { int m [ ] [ 4 ] = { { 9 , 8 , 7 , 1 } , { 7 , 3 , 0 , 2 } , { 9 , 5 , 3 , 2 } , { 6 , 3 , 1 , 2 } } ; int r = sizeof ( m [ 0 ] ) / sizeof ( m [ 0 ] [ 0 ] ) ; int c = sizeof ( m ) / sizeof ( m [ 0 ] ) ; sortRowWise ( m , r , c ) ; return 0 ; }