C Code:
void my_split(const char* tosplit, const char* delim, char** parsed, int* len)
{
char *local = strdup(tosplit);
char *tok = strtok(local, delim);
int i = 0;
while(tok) {
*parsed++ = strdup(tok);
i++;
tok = strtok(NULL, delim);
}
*len = i;
free(local);
}
Can anyone explain this to me? i know it parses with a delimeter
but im not quite sure how it works