A "Deeltal" keeps track of how many dividers an integer has (count) and keeps them in an array (dividers). 

Examples: 

value = 8 -> count = 3 and dividers = {1,2,4} 

value = 10, count = 3, dividers = {1,2,5}

Hope everything is clear, take a look at the following code:

```
typedef struct{
    int value;
    int count;
    int* dividers;
} Deeltal;

void free_dividers(Deeltal *g){  /*Deletes the int* dividers of a given Deeltal*/
    free (g - > dividers);
}

/* the following two functions have the same purpose: deleting the content of a 
given amount of "Deeltal" AND deleting the pointer to it aswell*/

void free_amountOfdeeltal(Deeltal *d, int amount){
    int i;
    for (i = 0; i < amount; i++){
        free_dividers(&d[i]);
    }
    free(d);
}

void free_amountOfdeeltalVersion2(Deeltal **g, int amount){
    int i;
    for(i = 0; i < amount; i++){
        free_dividers(&(*g)[i]);
    }
    free(*g);
}

```

If my main looked something like this 

```
int main(void){
    /*EDIT 3/11/2017: forgot to allocate memory for *d and initializing g.
    Thanks for pointing this out*/

    Deeltal g = 0;
    g.value = 6; g.count = 3; g.dividers = {1,2,3};

    Deeltal *d = malloc(sizeof(Deeltal));
    d->value = 6; d->count = 3; d->dividers = {1,2,3};

    free_amountOfdeeltal(&g);
    free_amountOfdeeltalVersion2(&d);
}

```

What is the difference between `free_amountOfdeeltal` and `free_amountOfdeeltalVersion2`? 

Both should do the same thing: releasing the memory of a `Deeltal` and also deleting the pointer pointing to that memory.

On a sidenote:
How do you delete the memory as well as the pointer?