Question: 7. Given two int arrays that are properly initialized, write a function, which merge the contents of the two arrays into a new array. The

 7. Given two int arrays that are properly initialized, write a

7. Given two int arrays that are properly initialized, write a function, which merge the contents of the two arrays into a new array. The size of new array is the sum of two existing arrays' sizes. 3 5 791 13 B | 10 | 20 | 30 | 40 | 50 C35791310 20304050 In the above example, A and B are the two original arrays. C is the resulting array. The function head is listed as follows. The Asize parameter is the array A size. Similarly, Bsize and Csize are the sizes of array B and C respectively. In this problem, we assume the arrays pointed by A and B are dynamically allocated by function caller. Array C should be dynamically allocated by the function. Please note the array stores the values of A before the values of B. After being merged, the array A and B should be released. (15 points) void arrMerge(int*& A, int, Asize, int*& B, int Bsize, int*& C, int& Csize)

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!