Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

How does strtok works?

Name: Anonymous 2009-04-17 16:47

I don't want to dig out the sources but i'd like to know how it implemented in C.

Name: Anonymous 2009-04-17 16:51

Use the source, Luke.

Name: Anonymous 2009-04-17 17:48

static variables

Name: Anonymous 2009-04-17 18:04

man strtok

Name: Anonymous 2009-04-17 18:13

Badly.

Name: Anonymous 2009-04-17 18:21

Terrible!

Name: Anonymous 2009-04-17 18:40

Advance the pointer past the leading whitespace. This is the pointer returned. Before returning, scan the string until encountering more whitespace or a NUL. Change this character to a NUL.

Name: Anonymous 2009-04-17 19:11

Just be aware that strtok in its traditional form uses static variables as >>4 mentioned and is thus non-reentrant. It's actually trivial to implement a reentrant strtok, though it would require you to pass in current state of tokenization on each function call

Name: Anonymous 2009-04-18 3:42

strtok considered unfunctional.

Name: Anonymous 2010-12-09 13:54

Name: Anonymous 2011-01-30 23:41

>>8
(call-with-current-tokenization strtok)

Name: Anonymous 2013-09-01 14:40


It was introduced in 1655 by John Wallis, and, since its introduction, has also been used outside mathematics in modern mysticism and literary symbology.

Don't change these.
Name: Email:
Entire Thread Thread List