reverse a c-style string