Function to reverse a [ ] from start to end
static void reverse ( char [ ] a , int start , int end ) { while ( start < end ) { char temp = a [ start ] ; a [ start ] = a [ end ] ; a [ end ] = temp ; start ++ ; end -- ; } }