Question: All code must be in C++ using G++ compiler Write a function that accepts an int array and the array's size as arguments. The function

All code must be in C++ using G++ compiler
Write a function that accepts an int array and the array's size as arguments. The function should create a new array, using dynamic memory allocation, that is of the same size as the argument array. The argument array's size is user defined in the main() function. Now, using pointers to both the arrays, first copy the elements at odd positions (1st, 3rd, 5th), and next copy the elements at even positions (2nd, 4th, 6th) from the argument array to the dynamically allocated array. Finally, in the same function, print the contents of the argument array and the newly created array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
