All pastes #371955 Raw Edit

Anonymous

public c v1 · immutable
#371955 ·published 2007-02-25 19:49 UTC
rendered paste body
// 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*/