k&r; exercise 1.19 - reverse string