Reverse a string in-place.
Anonimo
@Rahul, Wouldn't the for condition be i < strlen(str)/2? that way if you had a string of length 5, it would run for i=0 and i=1, but it wouldn't bother doing i=2 since that is the middle element and doesn't need switching. Without the /2, you will reverse it, then re-reverse it again. For an even length (like 6) you'd want it to do swaps on i=0, i=1, and i=2, but not i=3