Anonymous
public c v1 · immutable// Split a line up by spacesvoid handleLine(char* line, int fileIndex) { char* tok; int offset = 0; while((tok = strtok(line+offset," ")) != NULL) { printf("Token: '%s'\tOffset: %d\n",tok,offset); offset = offset+strlen(tok); }}// File it is reading:/*a b a b a b a babc def abc def abc def abc deftest testing one two threerofl lol lmao*/// What it returns:/*Token: 'a' Offset: 0Token: 'abc' Offset: 0Token: 'test' Offset: 0Token: 'rofl' Offset: 0*/