I am trying to find a way to create a dynamically allocated array of C strings. So far I have come with the following code that allows me to initialize an array of strings and change the value of an already existing index.

```
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

void replace_index(char *array[], int index, char *value) {
    array[index] = malloc(strlen(value) + 1);
    memmove(array[index], value, strlen(value) + 1);
}

int main(int argc, const char * argv[]) {
    char *strs[] = {"help", "me", "learn", "dynamic", "strings"};
    replace_index(strs, 2, "new_value");

    // The above code works fine, but I can not use it to add a value
    // beyond index 4.

    // The following line will not add the string to index 5.
    replace_index(strs, 5, "second_value");
}

```

The function `replace_index` will work to change the value of a string already include in the initializer, but will not work to add strings beyond the maximum index in the initializer. Is there a way to allocate more memory and add a new index?