Question: c++ programming. Array shifter using pointers USING G++ compiler PLEASE! Write a function that accepts an int array and the arrays size as arguments. The
c++ programming. Array shifter using pointers
USING G++ compiler PLEASE!
Write a function that accepts an int array and the arrays 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 arrays size is user defined in the main() function.
Now, using pointers to both the arrays, first copy the elements at odd positions (1 st , 3 rd , 5 th ), and next copy the elements at even positions (2 nd , 4 th , 6 th ) 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
