C examples for String:String Function
Find token with strrtok function
#include <stdio.h> #include <string.h> int main(void) { char data[] = " this is a test C is\t too#much\nfun!"; const char tokseps[] = " \t\n#"; /* separators */ char * pt;// w ww . j ava 2 s . co m puts(data); pt = strtok(data,tokseps); /* intial call */ while (pt) /* quit on NULL */ { puts (pt); /* show token */ pt = strtok(NULL, tokseps); /* next token */ } return 0; }