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

int main(void) {
    char s[] = "this is a string";
    char* x[100];
    unsigned int i = 0; 
    for (char *p = strtok(s," "); i != 100 && p != NULL; p = strtok(NULL, " ")) {
       x[i] = malloc(strlen(p)+1);
       strcpy(x[i], p);
       puts(x[i]);
       i++;
    }
    // Now you need to free the strings
    for (unsigned int j = 0 ; j != i ; j++) {
        free(x[j]);
    }
    return 0;
}