hi all , i need help with a c++ program here is the qustion
Question #
Write a program that contains a function named "remove_duplicates" that takes an array of integers in random order, and then eliminates all the duplicate integers in the array. The function should take three arguments:
(1) An array of integers which is (read and filled in main)
(2) The size of the array.
(3) A variable passed by reference to be printed in main to show how many values in the array
without duplication.
The function should not return a value, but if any duplicate integers are eliminated, then the function should count that, so the new value tells the number of distinct integers in the array. Suppose the array passed to the function is as shown below, and the size of the array passed to the function is 10.
0 1 2 3 4 5 6 7 8 9
58 | 26 | 91 | 26 | 70 | 70 | 91 | 58 | 58 | 66
The function should change the array to look like this:
0 1 2 3 4 5 6 7 8 9
58 | 26 | 91 | 70 | 66 | ?? | ?? | ?? | ?? | ??
and it should change the value of the distinct counter so that it is 5. The question marks in the cells after the 5th cell indicate that it does not matter what numbers are in those cells when the function returns.