adding C version of reverse_string