C++ program to reverse a string