Question: Hello, I need help with an assignment: There is no user input for this program. Create a char pointer. Initialize the pointer to point to

Hello, I need help with an assignment:

There is no user input for this program.

Create a char pointer. Initialize the pointer to point to "John Doe".

Print the name using the pointer.

Print the string in reverse order. That is print the last letter first, the second to the last letter next, and so on. You must use the char pointer for everything. You cannot use an index (subscript) anywhere in your program. That means you cannot have any [ ] in your program (no square brackets). Your code must work for any string not just "John Doe". Meaning if I change only your string from step 2 to "Samuel Smith", with no other modifications, your code should be able to print Samuel Smith backwards.

Print the string again as you did in step 3 (you will lose points for not printing the string again).

Do not use the CString class. Do not use the string class. Make sure all the code to reverse the string is your own original code. Do not use code or a routine authored by someone else even if that routine came with your C++ compiler. You can use the strlen function located in the cstring header file.

The final product should look like this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!