Last active
March 4, 2021 05:59
-
-
Save alsamitech/ba611a4b4befb8ba4dae14abcc07548c to your computer and use it in GitHub Desktop.
Compound Tokenizer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| char** atokl(char* InC, char* delim, long unsigned int* len){ | |
| char** tok=(char**)malloc(2*sizeof(char*)); | |
| //printf("%p\n", tok); | |
| tok[0]=strtok(strdup(InC), delim); | |
| { | |
| int i=1; | |
| while(tok[i-1]!=NULL){ | |
| tok=(char**)realloc(tok, (i+1)*sizeof(char*)); | |
| tok[i]=strtok(NULL, delim); | |
| //printf("%p\n", tok[i]); | |
| i++; | |
| } | |
| *len=i; | |
| /*EBRACE*/} | |
| return tok; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment