Question: Write a C++ function that takes a string as a parameter and reverse the string. The function contains the pointer to char, front and rear.
Write a C++ function that takes a string as a parameter and reverse the string. The function contains the pointer to char, front and rear. The front pointer initially referenced the first character in the string and the rear pointer reference to the last character in the string. Reverse the string by swapping the characters referenced by front and rear pointers. Then increment the front pointer and decrement the rear pointer and so on, until the entire string is reversed. Must be user input, not already in code.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
