Subj : Re: String memory Allocation To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Sun Oct 03 2004 02:13 pm 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. .. Ed > M. Finch wrote in message > news:41600d85$1@newsgroups.borland.com... > I'm still using char* and char mystring[stringsize] for strings.... > yes, I know. Its hard to change when you get old. > > I'm very confused about how memory is allocated for the > char*. I'm looking at the example in BCC 5.02 of the > strtok function. In the example, the > declare: > char input[16] = "abc,d"; > char *p; > > p = strtok(input, ","); > > My question is how or where is memory allocated for the > retuned string? > If it is allocated in the function, how does one know that? > After a bazillion calls to this function can it actually burn > up all of the memory available? > How do you release this memory if it is being used? > > I hope this is an appropriate place to ask this fundamental > question. .