Subj : Re: String memory Allocation To : borland.public.cpp.borlandcpp From : maeder Date : Sun Oct 03 2004 08:44 pm "Ed Mulroy [TeamB]" writes: > As I understand it, if the returned pointer is not NULL then it > contains an address in the original string that you passed to the > function and not an address of memory allocated by strtok. Or a pointer inside that string. To tokenize char input[16] = "abc,d,efg"; at ',' boundaries, you'd first do char const *firstToken(strtok(input,",")); and then, until strok() returns 0, char const *subsequentToken(strtok(0,",")); , i.e. if the first argument is 0, strtok() is to continue the previous tokenization. For this to work, strok() needs some internal memory. .