Combine Two Arrays Into ONE C++ Revise from Lab Exercise 8 to create a dynamic array with
Question:
Combine Two Arrays Into ONE C++
Revise from Lab Exercise 8 to create a dynamic array with the size from the user input. Modify the fillArray() function to return a pointer to the new array:
int* fillArray(int size, int low, int high); //return apointer of the dynamic array
In the main function, it will prompt to the user for the array size, low and high boundary for both arrays. Output the content of the two arrays. Then combine the two arrays into one by calling the combineArrays() function, and display the content of the new array before and after sorted.
int* combineArrays(int* array1, int* array2, int size1, int size2); // return a pointer of the combined array
Input Validation: Do not accept the size of array is zero or below, the lower bound value should be smaller or equal to the higher bound.
[Hints: Delete the two original arrays and the combined array before the program ends to avoid the memory leak.]
- Sample Output:
Managing Operations Across the Supply Chain
ISBN: 978-0078024030
2nd edition
Authors: Morgan Swink, Steven Melnyk, Bixby Cooper, Janet Hartley