Sorting strings using bubble sort
for ( int j = 0 ; j < n - 1 ; j ++ ) { for ( int i = j + 1 ; i < n ; i ++ ) { if ( strcmp ( arr [ j ] , arr [ i ] ) > 0 ) { strcpy ( temp , arr [ j ] ) ; strcpy ( arr [ j ] , arr [ i ] ) ; strcpy ( arr [ i ] , temp ) ; } } } }