Function to reverse an array from left index to right index ( both inclusive )
void ReverseArray ( string & arr , int left , int right ) { char temp ; while ( left < right ) { temp = arr [ left ] ; arr [ left ] = arr [ right ] ; arr [ right ] = temp ; left ++ ; right -- ; } }