Skip to content

Instantly share code, notes, and snippets.

@krisys
Created November 15, 2011 18:48
Show Gist options
  • Save krisys/1367941 to your computer and use it in GitHub Desktop.
Save krisys/1367941 to your computer and use it in GitHub Desktop.
strtok thread
/* thread 1 */
char *str1 = "1,2,3", *token;
token = strtok(str1, ",");
while(token != NULL){
token = strtok(NULL, delim);
}
/* thread 2 */
char *str2 = "a,b,c", *token;
token = strtok(str2, ",");
while(token != NULL){
token = strtok(NULL, delim);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment