Recommended Answers
Jump to Postbasically used to parse a text into smaller tokens, based on the delimiter u provide...
c89 standard strtok.. should give u an idea...$ is the delimiter here, the function takes the address of the stringto parse, so NULL probably means your not passing any string to it.
…
Jump to Poststrtok uses the name of the string on its first invocation, NULL thereafter for the same string.
that sounds good... any code exapmples?
Jump to Postthat sounds good... any code exapmples?
That's something you could (and should!) search for yourself, but I'll bite:
#include <stdio.h> #include <string.h> int main(void) { char src[] = "This is a test"; /* Note that it's an array and not a pointer */ char *tok …
Jump to Postim reading this page about strtok() being bad... and i quite like it... has quite a detailed explanation of things..
for those interested, this page has a nice and short definition of re entrancy, and also
All 13 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.