Question: C++ starting with #include using namespace std; Write a full C++ program that merges the following char arrays char first[] = Amos; char last[] =

C++ starting with
#include
using namespace std;
C++ starting with #include using namespace std; Write a full C++ program

Write a full C++ program that merges the following char arrays char first[] = "Amos"; char last[] = "Johnson"; Create a merge function Inputs are two pointers to the starting addresses of two char array and two integers of the size of each array. Dynamically allocate memory for a new char array with the needed amount of elements to merge the first name array and last name together plus having a space character between first and last name. Merge the two arrays together and store results in the new dynamically allocated array For example, "Amos", "Johnson" becomes "Amos Johnson" (see example below) Return the starting address of the new merged array Create a print function takes as input a starting address of a char array and its size prints out the elements of the array. In the main function 1. Pass the arrays first and last plus their sizes into your merge function 2. Use your print function to print out the outputted array from your merge function Note: Use function prototypes, use pointer notation for all arrays, and delete all allocated memory. Example First array | Amos Last array Johnson Outputted array Am o s on n son

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!