The Name Reversing Program - Fun with Arrays and Pointers

#include iostream
using namespace std;

int main()
{
string names[] = { "Ben Dover", "Chuck Roast", "Jim Naysium",
"Ella Quint", "Justin Case" };

char originalname[100], reversedname1[100], reversedname2[100];

for (int i=0; i<5; ++i)
{
strcpy(originalname,names[i].c_str());

reverseWithArrays( originalname , reversedname1 );
cout << originalname << " reversed with arrays is "
<< reversedname1 << endl;;

reverseWithPointers( originalname , reversedname2 );
cout << originalname << " reversed with pointers is "
<< reversedname2 << endl;;

cout << endl;
}

system("pause"); return 0;
}

Use this program as a starting point, add the two missing functions, and submit the new complete program. The reverseWithArrays function must use [ ] notation, and the reverseWithPointers function must use * notation. This program should produce output similar to the following:

Ben Dover reversed with arrays is Dover, Ben
Ben Dover reversed with pointers is Dover, Ben

Chuck Roast reversed with arrays is Roast, Chuck
Chuck Roast reversed with pointers is Roast, Chuck

Jim Naysium reversed with arrays is Naysium, Jim
Jim Naysium reversed with pointers is Naysium, Jim

Ella Quint reversed with arrays is Quint, Ella
Ella Quint reversed with pointers is Quint, Ella

Justin Case reversed with arrays is Case, Justin
Justin Case reversed with pointers is Case, Justin

Press any key to continue . . .
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.