The project I am working on states:
"Do programming project 3 in Chapter 7. In this version of the problem, return a new dynamic array where all repeated letters are deleted instead of modifying the partially filled array. Don't forget to free the memory allocated for these returned dynamic arrays when the data is no longer needed."
Project 3 in chapter seven states:
"Write a function called delete_repeats that has a partially filled array of characters as a formal parameter and that deletes all repeated letters from tje array. Since a partially filled array requires two arguments, the function will actually have two formal parameters; an array parameter and a formal parameter of type int that gives the number of array positions used. When a letter is deleted, the remaining letters are moved forward to fill in the gap. This will create empty positions at the end of the array so that less of the array is used. Since the formal parameter is a partially filled array, a second formal parameter of type int will tell how many array positions are filled. This second formal parameter will be a call-by-reference parameter and will be changed to show how much of the array is used after the repeated letters are deleted."
The code I have from project 3 is below, but I do not understand dynamic arrays, so I just need help doing the program and understanding it.
#include <iostream>
using namespace std;
void delete_repeats(char a[], int& size);
bool find_char (char target, char a[], int size);
int main()
{
char a[81] = "Mary had a little lamb. Her fleece was white as snow.";
int size = 53;