Question: IN C++ You need to write a function named doubleDupe. The function is described below: doubleDupe: : takes an int array and the arrays size
IN C++
You need to write a function named doubleDupe. The function is described below: doubleDupe: : takes an int array and the arrays size as arguments. The function should create a new array that is twice as big as the argument array. The new array should contain two copies of the original array, both in the original order. The function should return a pointer to the new array. Note: If a negative integer is passed as a parameter instead of the array's size, the function should return NULL (or nullptr). Use the main function to demonstrate your function. Assume the input will be a sequence of numbers, the first number will be the size of an array, followed by the elements of the array. Input the values in the array and call doubleDupe on it. Output the resultant array of the call doubleDupe. Ex.: If the input is 4 1 2 3 4 the output should be 1 2 3 4 1 2 3 4 If the input is 8 4 2 7 1 6 3 8 5 the output should be 4 2 7 1 6 3 8 5 4 2 7 1 6 3 8 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
