hi all!! I need to create a function that by reference reallocate an asymmetrical bidimensional
character matrix...
I've done something like that but it crash...


#include <iostream>

using namespace std;

void add(char ***list, int n, char *person)
static int GlobStrLen = 0;
*list = (char**) realloc(*list, GlobStrLen * sizeof(char**));
*list[n] = (char*) malloc (strlen(person) + 1);
strcpy(*list[n], person);
GlobStrLen += strlen(person) + 1;

int main()
char **list = NULL;
int n = 0;

add(&list, 0, "jack");
printf("list[0]: %s\n", list[0]);


add(&list, 1, "jeff");
printf("list[1]: %s\n", list[1]);

return 0;

================================END CODE============================

thank you for yours replies!!!