c++ program
Reverse
Write a program that takes a string as input (from the user) and then reverses the contents of the string. Your program should work by using two pointers. The "head" pointer should be set to the address of the first character in the string, and the "tail" pointer should be set to the address of the last character in the string (i.e. the character before the terminating null). The program should swap the characters referenced by these pointers, increment "head" to point to the next character, decrement "tail" to point to the second to last character, and so on, until all characters have been swapped and the entire string reversed.
Hint: Use the length of the string to calculate the address of the last character in the string. Loop until head >= tail. You may have to convert your string variable to an array of char- acters.
Filename: reverse.cpp