solution 1.2, reverse a null-terminated string using pointer operation