Question: Code in C++ please!! (5) Write a function that takes as an input parameter an array of integers and the size of the array as
Code in C++ please!!
(5) Write a function that takes as an input parameter an array of integers and the size of the array as a pointer. This function should go through the array and create a new array on the heap that removes all double-numbers that occur next to each other. The function should modify the arraysize parameter to the length of the new array with the multiple occurrences of numbers next to each other removed, and it should return the newly-created array. In other words, if the input array is: 5, 4, 4,3,6 ,6, 6,8, 9, 5,1,3,8,8,1,8,9,9,3,2,2,2,6,1 The returned array would be: 5, 4,3,6,8,9,5,1,3,8,1,8,9,3,2,6,1,:2 And the size would be adjusted to:18 17. ,2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
