Here you go, comments added
HTML Code:
char *local = strdup(tosplit); // makes a copy of tosplit, and
// returns a pointer to the allocated copy
char *tok = strtok(local, delim); // split local into tokens using
// delim, store the first token in tok
int i = 0; // counter for token
while(tok) { // while token is not null
*parsed++ = strdup(tok); // makes a copy of token,
// returns a pointer to the allocated copy which is stored in
// parsed, parsed is then increment to point to the next
// pointer
i++; // increment the number of tokens parsed
tok = strtok(NULL, delim); // get next token
}
*len = i; // stores the number of tokens in len
free(local); // frees the memory taken up local
// when the function returns, *parsed will contain tokens created from tosplit