So if we were to go with your earlier code, it would look something like this:
Code:
char * temp = NULL;
char ** array = NULL;
...
...
array = malloc(word_count); /* word_count should be number of pointers to char we need in array */
temp = strtok(string," ");
array[0] = malloc(strlen(temp) + 1);
strcpy(array[0],temp);
for(i=1; i<= word_count-1;i++)
{
temp = strtrok(NULL," ");
array[i] = malloc(strlen(temp) + 1);
strcpy(array[i],temp)
}
something like that with lots more error checking, this is a total minimalist almost pseudo code, as you can see from the work thats being done (this without ANY error checking) this is very sloppy approach.
One other thing, it's usually not a good idea to call strtok on a string defined as char * string = "blah blah blah" because strtok modifies the string its called on.