Question: For the assignment, we will write a program that uses a function called deleteRepeats that has an array of characters as a formal parameter, and

For the assignment, we will write a program that uses a function called deleteRepeats that has an array of characters as a formal parameter, and that deletes all repeated letters from the array. The number of array positions used will be found in a constant aptly named SIZE, and it will not be passed as a parameter. The function will return a unique pointer.
The function should determine if a letter repeated and, if so, that letter is deleted. You may rewrite the current array by deleting and shifting over, which will create empty positions at the end of the array so that less of the array is used. Or you can write the non-repeats to the new dynamic array. Or some other strategy. This part of the logic is entirely up to you. Eventually the remaining letters will form the new array.
The new, dynamic array is a result of the deletion activities (i.e., holds just the unique elements). This array is created using a smart (unique) pointer. After the work is finished, the function will return the smart pointer and your program should print the new array using that smart pointer and report the difference. This can be done in the driver program (no additional function needed). Consider using a range based for loop and perhaps have an ongoing count too.
 For the assignment, we will write a program that uses a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!