IBM interview question

reverse a string in C++