you do not appear to have allocated any memory for the internal arrays of char.
when you make a char**, you have to new twice, once on the outside for the array of strings, and again for each string for its max length. This is typically done in a loop..
char ** foo;
foo = new char *[10]; //an array of 10 unalloacated char pointers.
for(i = 0; i<10; i++)
foo[i] = new char[100]; //now each char array in your array of arrays has memory also.
My code presume:
1 – you are not trying to write your own version of strtok();
2 – you can’t, for any reason, use c++ containers (otherwise the solution would be less then trivial);
3 – you can ensure that your strings are null-terminate.